From: Lee Jones <lee@kernel.org>
To: Stefan Wahren <wahrenst@gmx.net>
Cc: Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Pavel Machek <pavel@ucw.cz>,
bcm-kernel-feedback-list@broadcom.com,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-leds@vger.kernel.org
Subject: Re: [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
Date: Fri, 1 Dec 2023 11:23:30 +0000 [thread overview]
Message-ID: <20231201112330.GD3259151@google.com> (raw)
In-Reply-To: <20231118124252.14838-2-wahrenst@gmx.net>
On Sat, 18 Nov 2023, Stefan Wahren wrote:
> In case leds-gpio fails to get the GPIO from the DT (e.g. the GPIO is
> already requested) the driver doesn't provide any helpful error log:
>
> leds-gpio: probe of leds failed with error -16
>
> So add a new error log in case devm_fwnode_gpiod_get() fails.
>
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> ---
> drivers/leds/leds-gpio.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index 710c319ad312..0159cedffa9e 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -172,6 +172,8 @@ static struct gpio_leds_priv *gpio_leds_create(struct device *dev)
> led.gpiod = devm_fwnode_gpiod_get(dev, child, NULL, GPIOD_ASIS,
> NULL);
> if (IS_ERR(led.gpiod)) {
> + dev_err_probe(dev, PTR_ERR(led.gpiod), "Failed to get gpio '%pfw'\n",
Nit: GPIO
> + child);
> fwnode_handle_put(child);
> return ERR_CAST(led.gpiod);
> }
> --
> 2.34.1
>
--
Lee Jones [李琼斯]
WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee@kernel.org>
To: Stefan Wahren <wahrenst@gmx.net>
Cc: Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Pavel Machek <pavel@ucw.cz>,
bcm-kernel-feedback-list@broadcom.com,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-leds@vger.kernel.org
Subject: Re: [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
Date: Fri, 1 Dec 2023 11:23:30 +0000 [thread overview]
Message-ID: <20231201112330.GD3259151@google.com> (raw)
In-Reply-To: <20231118124252.14838-2-wahrenst@gmx.net>
On Sat, 18 Nov 2023, Stefan Wahren wrote:
> In case leds-gpio fails to get the GPIO from the DT (e.g. the GPIO is
> already requested) the driver doesn't provide any helpful error log:
>
> leds-gpio: probe of leds failed with error -16
>
> So add a new error log in case devm_fwnode_gpiod_get() fails.
>
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> ---
> drivers/leds/leds-gpio.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index 710c319ad312..0159cedffa9e 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -172,6 +172,8 @@ static struct gpio_leds_priv *gpio_leds_create(struct device *dev)
> led.gpiod = devm_fwnode_gpiod_get(dev, child, NULL, GPIOD_ASIS,
> NULL);
> if (IS_ERR(led.gpiod)) {
> + dev_err_probe(dev, PTR_ERR(led.gpiod), "Failed to get gpio '%pfw'\n",
Nit: GPIO
> + child);
> fwnode_handle_put(child);
> return ERR_CAST(led.gpiod);
> }
> --
> 2.34.1
>
--
Lee Jones [李琼斯]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-12-01 11:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-18 12:42 [PATCH V2 0/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Stefan Wahren
2023-11-18 12:42 ` Stefan Wahren
2023-11-18 12:42 ` [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails Stefan Wahren
2023-11-18 12:42 ` Stefan Wahren
2023-11-20 11:47 ` Andy Shevchenko
2023-11-20 11:47 ` Andy Shevchenko
2023-11-20 12:02 ` Stefan Wahren
2023-11-20 12:02 ` Stefan Wahren
2023-11-20 12:36 ` Andy Shevchenko
2023-11-20 12:36 ` Andy Shevchenko
2023-11-22 10:52 ` Bartosz Golaszewski
2023-11-22 10:52 ` Bartosz Golaszewski
2023-11-28 17:15 ` Stefan Wahren
2023-11-28 17:15 ` Stefan Wahren
2023-11-29 14:03 ` Linus Walleij
2023-11-29 14:03 ` Linus Walleij
2023-11-29 15:07 ` Stefan Wahren
2023-11-29 15:07 ` Stefan Wahren
2023-12-01 11:23 ` Lee Jones [this message]
2023-12-01 11:23 ` Lee Jones
2023-11-18 12:42 ` [PATCH V2 2/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Stefan Wahren
2023-11-18 12:42 ` Stefan Wahren
2023-11-29 0:26 ` Florian Fainelli
2023-11-29 0:26 ` Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231201112330.GD3259151@google.com \
--to=lee@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=robh+dt@kernel.org \
--cc=wahrenst@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.