* [PATCH 0/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act
@ 2023-11-05 15:49 Stefan Wahren
2023-11-05 15:49 ` [PATCH 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails Stefan Wahren
2023-11-05 15:49 ` [PATCH 2/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Stefan Wahren
0 siblings, 2 replies; 5+ messages in thread
From: Stefan Wahren @ 2023-11-05 15:49 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.
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
_______________________________________________
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] 5+ messages in thread
* [PATCH 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
2023-11-05 15:49 [PATCH 0/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Stefan Wahren
@ 2023-11-05 15:49 ` Stefan Wahren
2023-11-06 11:19 ` Andy Shevchenko
2023-11-05 15:49 ` [PATCH 2/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Stefan Wahren
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Wahren @ 2023-11-05 15:49 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..284a9e66fd9e 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(dev, "Failed to get gpio '%pfw': %ld\n",
+ child, PTR_ERR(led.gpiod));
fwnode_handle_put(child);
return ERR_CAST(led.gpiod);
}
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act
2023-11-05 15:49 [PATCH 0/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Stefan Wahren
2023-11-05 15:49 ` [PATCH 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails Stefan Wahren
@ 2023-11-05 15:49 ` Stefan Wahren
1 sibling, 0 replies; 5+ messages in thread
From: Stefan Wahren @ 2023-11-05 15:49 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
2023-11-05 15:49 ` [PATCH 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails Stefan Wahren
@ 2023-11-06 11:19 ` Andy Shevchenko
2023-11-18 12:31 ` Stefan Wahren
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2023-11-06 11:19 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 Sun, Nov 05, 2023 at 04:49:39PM +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(dev, "Failed to get gpio '%pfw': %ld\n",
> + child, PTR_ERR(led.gpiod));
Perhaps %pe ?
> fwnode_handle_put(child);
> return ERR_CAST(led.gpiod);
> }
--
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] 5+ messages in thread
* Re: [PATCH 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
2023-11-06 11:19 ` Andy Shevchenko
@ 2023-11-18 12:31 ` Stefan Wahren
0 siblings, 0 replies; 5+ messages in thread
From: Stefan Wahren @ 2023-11-18 12:31 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
Pavel Machek, Lee Jones, bcm-kernel-feedback-list, devicetree,
linux-arm-kernel, linux-leds
Hi Andy,
Am 06.11.23 um 12:19 schrieb Andy Shevchenko:
> On Sun, Nov 05, 2023 at 04:49:39PM +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(dev, "Failed to get gpio '%pfw': %ld\n",
>> + child, PTR_ERR(led.gpiod));
> Perhaps %pe ?
i notice that i need to use dev_err_probe because of EPROBE_DEFER
anyway. So i will drop the second parameter in the next version.
>
>> fwnode_handle_put(child);
>> return ERR_CAST(led.gpiod);
>> }
_______________________________________________
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] 5+ messages in thread
end of thread, other threads:[~2023-11-18 12:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-05 15:49 [PATCH 0/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Stefan Wahren
2023-11-05 15:49 ` [PATCH 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails Stefan Wahren
2023-11-06 11:19 ` Andy Shevchenko
2023-11-18 12:31 ` Stefan Wahren
2023-11-05 15:49 ` [PATCH 2/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Stefan Wahren
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).