[PATCH v1 1/7] gpiolib: Print actual error when descriptor contains an error pointer

Andy Shevchenko posted 7 patches 8 months, 1 week ago
There is a newer version of this series
[PATCH v1 1/7] gpiolib: Print actual error when descriptor contains an error pointer
Posted by Andy Shevchenko 8 months, 1 week ago
Print the actual error when descriptor contains an error pointer.
This might help debugging those rare cases.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index eb94428af6c0..0089745b381f 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2445,7 +2445,7 @@ static int validate_desc(const struct gpio_desc *desc, const char *func)
 		return 0;
 
 	if (IS_ERR(desc)) {
-		pr_warn("%s: invalid GPIO (errorpointer)\n", func);
+		pr_warn("%s: invalid GPIO (errorpointer: %pe)\n", func, desc);
 		return PTR_ERR(desc);
 	}
 
-- 
2.47.2
Re: [PATCH v1 1/7] gpiolib: Print actual error when descriptor contains an error pointer
Posted by Linus Walleij 8 months, 1 week ago
On Tue, Apr 15, 2025 at 1:11 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> Print the actual error when descriptor contains an error pointer.
> This might help debugging those rare cases.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij