gpiolib: Print actual error when descriptor contains an error pointer
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 16 Apr 2025 09:55:11 +0000 (12:55 +0300)
committerBartosz Golaszewski <brgl@bgdev.pl>
Thu, 17 Apr 2025 13:22:05 +0000 (15:22 +0200)
Print the actual error when descriptor contains an error pointer.
This might help debugging those rare cases.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250416095645.2027695-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
drivers/gpio/gpiolib.c

index e2716e20b0e476c8d355292a4809a01b40a736b9..e8e75da7b177092b2180ff33feefe07daeefe5b0 100644 (file)
@@ -2443,7 +2443,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);
        }