[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201118142917.25752-1-grygorii.strashko@ti.com>
Date: Wed, 18 Nov 2020 16:29:17 +0200
From: Grygorii Strashko <grygorii.strashko@...com>
To: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>
CC: <linux-gpio@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Grygorii Strashko <grygorii.strashko@...com>
Subject: [PATCH] gpiolib: do not print err message for EPROBE_DEFER
The gpiochip may have dependencies from pinmux and so got deferred. Now it
will print error message every time -EPROBE_DEFER is returned which is
unnecessary:
"gpiochip_add_data_with_key: GPIOs 0..31 (gpio-0-31) failed to register, -517"
Hence, do suppress error message for -EPROBE_DEFER case.
Signed-off-by: Grygorii Strashko <grygorii.strashko@...com>
---
drivers/gpio/gpiolib.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 089ddcaa9bc6..fd2c503a6aab 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -771,9 +771,11 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
ida_free(&gpio_ida, gdev->id);
err_free_gdev:
/* failures here can mean systems won't boot... */
- pr_err("%s: GPIOs %d..%d (%s) failed to register, %d\n", __func__,
- gdev->base, gdev->base + gdev->ngpio - 1,
- gc->label ? : "generic", ret);
+ if (ret != -EPROBE_DEFER) {
+ pr_err("%s: GPIOs %d..%d (%s) failed to register, %d\n", __func__,
+ gdev->base, gdev->base + gdev->ngpio - 1,
+ gc->label ? : "generic", ret);
+ }
kfree(gdev);
return ret;
}
--
2.17.1
Powered by blists - more mailing lists