* [PATCH V2 0/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act
@ 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 ` [PATCH V2 2/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Stefan Wahren
0 siblings, 2 replies; 12+ messages in thread
From: Stefan Wahren @ 2023-11-18 12:42 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
Pavel Machek, Lee Jones
Cc: bcm-kernel-feedback-list, Andy Shevchenko, devicetree,
linux-arm-kernel, linux-leds, Stefan Wahren
This series fixes the probing of leds-gpio on the Raspberry Pi 400.
Also try to improve the error logging of leds-gpio.
Changes in V2:
- replace dev_err with dev_err_probe in patch 1 to handle EPROBE_DEFER
properly
Stefan Wahren (2):
leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act
arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts | 4 +---
drivers/leds/leds-gpio.c | 2 ++
2 files changed, 3 insertions(+), 3 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
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-20 11:47 ` Andy Shevchenko
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
1 sibling, 2 replies; 12+ messages in thread
From: Stefan Wahren @ 2023-11-18 12:42 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
Pavel Machek, Lee Jones
Cc: bcm-kernel-feedback-list, Andy Shevchenko, devicetree,
linux-arm-kernel, linux-leds, Stefan Wahren
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",
+ child);
fwnode_handle_put(child);
return ERR_CAST(led.gpiod);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH V2 2/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act
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 ` [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-29 0:26 ` Florian Fainelli
1 sibling, 1 reply; 12+ messages in thread
From: Stefan Wahren @ 2023-11-18 12:42 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
Pavel Machek, Lee Jones
Cc: bcm-kernel-feedback-list, Andy Shevchenko, devicetree,
linux-arm-kernel, linux-leds, Stefan Wahren
The LED ACT which is included from bcm2711-rpi-4-b doesn't exists
on the Raspberry Pi 400. So the bcm2711-rpi-400.dts tries to
use the delete-node directive in order to remove the complete
node. Unfortunately the usage get broken in commit 1156e3a78bcc
("ARM: dts: bcm283x: Move ACT LED into separate dtsi")
and now ACT and PWR LED using the same GPIO and this prevent
probing of led-gpios on Raspberry Pi 400:
leds-gpio: probe of leds failed with error -16
So fix the delete-node directive.
Fixes: 1156e3a78bcc ("ARM: dts: bcm283x: Move ACT LED into separate dtsi")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts
index 1ab8184302db..5a2869a18bd5 100644
--- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts
+++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts
@@ -36,9 +36,7 @@ &led_pwr {
gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
};
-&leds {
- /delete-node/ led_act;
-};
+/delete-node/ &led_act;
&pm {
/delete-property/ system-power-controller;
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
2023-11-18 12:42 ` [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails Stefan Wahren
@ 2023-11-20 11:47 ` Andy Shevchenko
2023-11-20 12:02 ` Stefan Wahren
2023-12-01 11:23 ` Lee Jones
1 sibling, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2023-11-20 11:47 UTC (permalink / raw)
To: Stefan Wahren
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
Pavel Machek, Lee Jones, bcm-kernel-feedback-list, devicetree,
linux-arm-kernel, linux-leds
On Sat, Nov 18, 2023 at 01:42:51PM +0100, 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.
...
> 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",
> + child);
> fwnode_handle_put(child);
> return ERR_CAST(led.gpiod);
> }
Thinking more about it. GPIO library already issues bunch of messages.
"using DT ... for ... GPIO lookup"
"using lookup tables for GPIO lookup"
"No GPIO consumer ... found"
Isn't it enough?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
2023-11-20 11:47 ` Andy Shevchenko
@ 2023-11-20 12:02 ` Stefan Wahren
2023-11-20 12:36 ` Andy Shevchenko
0 siblings, 1 reply; 12+ messages in thread
From: Stefan Wahren @ 2023-11-20 12:02 UTC (permalink / raw)
To: Andy Shevchenko, Linus Walleij, Bartosz Golaszewski
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
Pavel Machek, open list:GPIO SUBSYSTEM, Lee Jones,
bcm-kernel-feedback-list, devicetree, linux-arm-kernel,
linux-leds
Hi Andy,
[add Linus and Bartosz]
Am 20.11.23 um 12:47 schrieb Andy Shevchenko:
> On Sat, Nov 18, 2023 at 01:42:51PM +0100, 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.
> ...
>
>> 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",
>> + child);
>> fwnode_handle_put(child);
>> return ERR_CAST(led.gpiod);
>> }
> Thinking more about it. GPIO library already issues bunch of messages.
>
> "using DT ... for ... GPIO lookup"
> "using lookup tables for GPIO lookup"
> "No GPIO consumer ... found"
are these errors or debug messages?
I cannot remember that i saw any of them on info level in my case of an
already allocated pin (see patch 2).
I'm open to place the log within gpiolib, if this a better place.
Best regards
>
> Isn't it enough?
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
2023-11-20 12:02 ` Stefan Wahren
@ 2023-11-20 12:36 ` Andy Shevchenko
2023-11-22 10:52 ` Bartosz Golaszewski
0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2023-11-20 12:36 UTC (permalink / raw)
To: Stefan Wahren
Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Pavel Machek,
open list:GPIO SUBSYSTEM, Lee Jones, bcm-kernel-feedback-list,
devicetree, linux-arm-kernel, linux-leds
On Mon, Nov 20, 2023 at 01:02:55PM +0100, Stefan Wahren wrote:
> Am 20.11.23 um 12:47 schrieb Andy Shevchenko:
> > On Sat, Nov 18, 2023 at 01:42:51PM +0100, 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.
...
> > > 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",
> > > + child);
> > > fwnode_handle_put(child);
> > > return ERR_CAST(led.gpiod);
> > > }
> > Thinking more about it. GPIO library already issues bunch of messages.
> >
> > "using DT ... for ... GPIO lookup"
> > "using lookup tables for GPIO lookup"
> > "No GPIO consumer ... found"
> are these errors or debug messages?
Indeed they are on debug level.
> I cannot remember that i saw any of them on info level in my case of an
> already allocated pin (see patch 2).
>
> I'm open to place the log within gpiolib, if this a better place.
I'm not sure, let's hear GPIO maintainers for that.
> > Isn't it enough?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
2023-11-20 12:36 ` Andy Shevchenko
@ 2023-11-22 10:52 ` Bartosz Golaszewski
2023-11-28 17:15 ` Stefan Wahren
2023-11-29 14:03 ` Linus Walleij
0 siblings, 2 replies; 12+ messages in thread
From: Bartosz Golaszewski @ 2023-11-22 10:52 UTC (permalink / raw)
To: Andy Shevchenko, Linus Walleij
Cc: Stefan Wahren, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Florian Fainelli, Pavel Machek, open list:GPIO SUBSYSTEM,
Lee Jones, bcm-kernel-feedback-list, devicetree, linux-arm-kernel,
linux-leds
On Mon, Nov 20, 2023 at 1:36 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Mon, Nov 20, 2023 at 01:02:55PM +0100, Stefan Wahren wrote:
> > Am 20.11.23 um 12:47 schrieb Andy Shevchenko:
> > > On Sat, Nov 18, 2023 at 01:42:51PM +0100, 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.
>
> ...
>
> > > > 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",
> > > > + child);
> > > > fwnode_handle_put(child);
> > > > return ERR_CAST(led.gpiod);
> > > > }
> > > Thinking more about it. GPIO library already issues bunch of messages.
> > >
> > > "using DT ... for ... GPIO lookup"
> > > "using lookup tables for GPIO lookup"
> > > "No GPIO consumer ... found"
> > are these errors or debug messages?
>
> Indeed they are on debug level.
>
> > I cannot remember that i saw any of them on info level in my case of an
> > already allocated pin (see patch 2).
> >
> > I'm open to place the log within gpiolib, if this a better place.
>
> I'm not sure, let's hear GPIO maintainers for that.
>
Hard to tell which method is preferred among all the subsystems.
Personally I'm more inclined towards letting drivers decide whether to
emit an error message and only emit our own when an error cannot be
propagated down the stack.
Linus: Any thoughts?
Bart
> > > Isn't it enough?
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
2023-11-22 10:52 ` Bartosz Golaszewski
@ 2023-11-28 17:15 ` Stefan Wahren
2023-11-29 14:03 ` Linus Walleij
1 sibling, 0 replies; 12+ messages in thread
From: Stefan Wahren @ 2023-11-28 17:15 UTC (permalink / raw)
To: Bartosz Golaszewski, Linus Walleij
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
Pavel Machek, open list:GPIO SUBSYSTEM, Lee Jones,
bcm-kernel-feedback-list, Andy Shevchenko, devicetree,
linux-arm-kernel, linux-leds
Am 22.11.23 um 11:52 schrieb Bartosz Golaszewski:
> On Mon, Nov 20, 2023 at 1:36 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
>> On Mon, Nov 20, 2023 at 01:02:55PM +0100, Stefan Wahren wrote:
>>> Am 20.11.23 um 12:47 schrieb Andy Shevchenko:
>>>> On Sat, Nov 18, 2023 at 01:42:51PM +0100, 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.
>> ...
>>
>>>>> 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",
>>>>> + child);
>>>>> fwnode_handle_put(child);
>>>>> return ERR_CAST(led.gpiod);
>>>>> }
>>>> Thinking more about it. GPIO library already issues bunch of messages.
>>>>
>>>> "using DT ... for ... GPIO lookup"
>>>> "using lookup tables for GPIO lookup"
>>>> "No GPIO consumer ... found"
>>> are these errors or debug messages?
>> Indeed they are on debug level.
>>
>>> I cannot remember that i saw any of them on info level in my case of an
>>> already allocated pin (see patch 2).
>>>
>>> I'm open to place the log within gpiolib, if this a better place.
>> I'm not sure, let's hear GPIO maintainers for that.
>>
> Hard to tell which method is preferred among all the subsystems.
> Personally I'm more inclined towards letting drivers decide whether to
> emit an error message and only emit our own when an error cannot be
> propagated down the stack.
>
> Linus: Any thoughts?
gentle ping ...
>
> Bart
>
>>>> Isn't it enough?
>> --
>> With Best Regards,
>> Andy Shevchenko
>>
>>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH V2 2/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act
2023-11-18 12:42 ` [PATCH V2 2/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Stefan Wahren
@ 2023-11-29 0:26 ` Florian Fainelli
0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2023-11-29 0:26 UTC (permalink / raw)
To: bcm-kernel-feedback-list, Stefan Wahren, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Pavel Machek,
Lee Jones
Cc: Florian Fainelli, Andy Shevchenko, devicetree, linux-arm-kernel,
linux-leds
From: Florian Fainelli <f.fainelli@gmail.com>
On Sat, 18 Nov 2023 13:42:52 +0100, Stefan Wahren <wahrenst@gmx.net> wrote:
> The LED ACT which is included from bcm2711-rpi-4-b doesn't exists
> on the Raspberry Pi 400. So the bcm2711-rpi-400.dts tries to
> use the delete-node directive in order to remove the complete
> node. Unfortunately the usage get broken in commit 1156e3a78bcc
> ("ARM: dts: bcm283x: Move ACT LED into separate dtsi")
> and now ACT and PWR LED using the same GPIO and this prevent
> probing of led-gpios on Raspberry Pi 400:
>
> leds-gpio: probe of leds failed with error -16
>
> So fix the delete-node directive.
>
> Fixes: 1156e3a78bcc ("ARM: dts: bcm283x: Move ACT LED into separate dtsi")
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> ---
Applied to https://github.com/Broadcom/stblinux/commits/devicetree/fixes, thanks!
--
Florian
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
2023-11-22 10:52 ` Bartosz Golaszewski
2023-11-28 17:15 ` Stefan Wahren
@ 2023-11-29 14:03 ` Linus Walleij
2023-11-29 15:07 ` Stefan Wahren
1 sibling, 1 reply; 12+ messages in thread
From: Linus Walleij @ 2023-11-29 14:03 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Andy Shevchenko, Stefan Wahren, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Florian Fainelli, Pavel Machek,
open list:GPIO SUBSYSTEM, Lee Jones, bcm-kernel-feedback-list,
devicetree, linux-arm-kernel, linux-leds
On Wed, Nov 22, 2023 at 11:53 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > > I cannot remember that i saw any of them on info level in my case of an
> > > already allocated pin (see patch 2).
> > >
> > > I'm open to place the log within gpiolib, if this a better place.
> >
> > I'm not sure, let's hear GPIO maintainers for that.
>
> Hard to tell which method is preferred among all the subsystems.
> Personally I'm more inclined towards letting drivers decide whether to
> emit an error message and only emit our own when an error cannot be
> propagated down the stack.
>
> Linus: Any thoughts?
I never managed to get it right so I can't give any good advice.
Usually I tend to think better one more error message than one too little.
Then again I'm a dmesg maximalist who just want it to scroll on forever
also with positive messages...
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
2023-11-29 14:03 ` Linus Walleij
@ 2023-11-29 15:07 ` Stefan Wahren
0 siblings, 0 replies; 12+ messages in thread
From: Stefan Wahren @ 2023-11-29 15:07 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
Pavel Machek, open list:GPIO SUBSYSTEM, Lee Jones,
bcm-kernel-feedback-list, devicetree, linux-arm-kernel,
linux-leds
Am 29.11.23 um 15:03 schrieb Linus Walleij:
> On Wed, Nov 22, 2023 at 11:53 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
>>>> I cannot remember that i saw any of them on info level in my case of an
>>>> already allocated pin (see patch 2).
>>>>
>>>> I'm open to place the log within gpiolib, if this a better place.
>>> I'm not sure, let's hear GPIO maintainers for that.
>> Hard to tell which method is preferred among all the subsystems.
>> Personally I'm more inclined towards letting drivers decide whether to
>> emit an error message and only emit our own when an error cannot be
>> propagated down the stack.
>>
>> Linus: Any thoughts?
> I never managed to get it right so I can't give any good advice.
>
> Usually I tend to think better one more error message than one too little.
>
> Then again I'm a dmesg maximalist who just want it to scroll on forever
> also with positive messages...
Okay, based on the feedback this sounds like nobody is against this patch?
>
> Yours,
> Linus Walleij
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
2023-11-18 12:42 ` [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails Stefan Wahren
2023-11-20 11:47 ` Andy Shevchenko
@ 2023-12-01 11:23 ` Lee Jones
1 sibling, 0 replies; 12+ messages in thread
From: Lee Jones @ 2023-12-01 11:23 UTC (permalink / raw)
To: Stefan Wahren
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
Pavel Machek, bcm-kernel-feedback-list, Andy Shevchenko,
devicetree, linux-arm-kernel, linux-leds
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 [李琼斯]
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-12-01 11:23 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails Stefan Wahren
2023-11-20 11:47 ` Andy Shevchenko
2023-11-20 12:02 ` Stefan Wahren
2023-11-20 12:36 ` Andy Shevchenko
2023-11-22 10:52 ` Bartosz Golaszewski
2023-11-28 17:15 ` Stefan Wahren
2023-11-29 14:03 ` Linus Walleij
2023-11-29 15:07 ` Stefan Wahren
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-29 0:26 ` Florian Fainelli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).