* [PATCH] leds: lp55xx: use gpiod_set_value_cansleep
@ 2023-09-18 14:32 Stefan Eichenberger
2023-09-21 10:47 ` (subset) " Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Eichenberger @ 2023-09-18 14:32 UTC (permalink / raw)
To: linux-leds; +Cc: pavel, lee
Use gpiod_set_value_cansleep in the init_device function. Without this
change, the driver may print a warning if the LP55xx enable pin is
connected to a GPIO chip which can sleep (e.g. a GPIO expander):
WARNING: CPU: 0 PID: 2719 at drivers/gpio/gpiolib.c:3051 gpiod_set_value+0x64/0xbc
Signed-off-by: Stefan Eichenberger <eichest@gmail.com>
---
drivers/leds/leds-lp55xx-common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c
index 77bb26906ea6e..8e7074f0fee00 100644
--- a/drivers/leds/leds-lp55xx-common.c
+++ b/drivers/leds/leds-lp55xx-common.c
@@ -442,9 +442,9 @@ int lp55xx_init_device(struct lp55xx_chip *chip)
gpiod_direction_output(pdata->enable_gpiod, 0);
gpiod_set_consumer_name(pdata->enable_gpiod, "LP55xx enable");
- gpiod_set_value(pdata->enable_gpiod, 0);
+ gpiod_set_value_cansleep(pdata->enable_gpiod, 0);
usleep_range(1000, 2000); /* Keep enable down at least 1ms */
- gpiod_set_value(pdata->enable_gpiod, 1);
+ gpiod_set_value_cansleep(pdata->enable_gpiod, 1);
usleep_range(1000, 2000); /* 500us abs min. */
}
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: (subset) [PATCH] leds: lp55xx: use gpiod_set_value_cansleep
2023-09-18 14:32 [PATCH] leds: lp55xx: use gpiod_set_value_cansleep Stefan Eichenberger
@ 2023-09-21 10:47 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2023-09-21 10:47 UTC (permalink / raw)
To: linux-leds, Stefan Eichenberger; +Cc: pavel, lee
On Mon, 18 Sep 2023 16:32:38 +0200, Stefan Eichenberger wrote:
> Use gpiod_set_value_cansleep in the init_device function. Without this
> change, the driver may print a warning if the LP55xx enable pin is
> connected to a GPIO chip which can sleep (e.g. a GPIO expander):
> WARNING: CPU: 0 PID: 2719 at drivers/gpio/gpiolib.c:3051 gpiod_set_value+0x64/0xbc
>
>
Applied, thanks!
[1/1] leds: lp55xx: use gpiod_set_value_cansleep
commit: e62db9d5be9bc96e121013b35987dfa850c040f9
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-21 21:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-18 14:32 [PATCH] leds: lp55xx: use gpiod_set_value_cansleep Stefan Eichenberger
2023-09-21 10:47 ` (subset) " Lee Jones
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).