diff mbox series

[v4,2/2] gpiolib: use dev_err() when gpiod_configure_flags failed

Message ID 20240325171804.3375280-3-andriy.shevchenko@linux.intel.com
State New
Headers show
Series gpiolib: Fix/update messaging | expand

Commit Message

Andy Shevchenko March 25, 2024, 5:16 p.m. UTC
From: Peng Fan <peng.fan@nxp.com>

When gpio-ranges property was missed to be added in the gpio node,
using dev_err() to show an error message will helping to locate issues
easier.

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

Comments

Bartosz Golaszewski April 2, 2024, 8:50 a.m. UTC | #1
On Mon, Mar 25, 2024 at 6:18 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> When gpio-ranges property was missed to be added in the gpio node,
> using dev_err() to show an error message will helping to locate issues
> easier.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> 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 b98cbf4335e3..5589e085ba25 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -4236,7 +4236,7 @@ struct gpio_desc *gpiod_find_and_request(struct device *consumer,
>         ret = gpiod_configure_flags(desc, con_id, lookupflags, flags);
>         if (ret < 0) {
>                 gpiod_put(desc);
> -               dev_dbg(consumer, "setup of GPIO %s failed\n", name);
> +               dev_err(consumer, "setup of GPIO %s failed: %d\n", name, ret);
>                 return ERR_PTR(ret);
>         }
>
> --
> 2.43.0.rc1.1.gbec44491f096
>

Applied, thanks!

Bart
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index b98cbf4335e3..5589e085ba25 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -4236,7 +4236,7 @@  struct gpio_desc *gpiod_find_and_request(struct device *consumer,
 	ret = gpiod_configure_flags(desc, con_id, lookupflags, flags);
 	if (ret < 0) {
 		gpiod_put(desc);
-		dev_dbg(consumer, "setup of GPIO %s failed\n", name);
+		dev_err(consumer, "setup of GPIO %s failed: %d\n", name, ret);
 		return ERR_PTR(ret);
 	}