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

Andy Shevchenko
2025-04-15T11:12:37Z

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