Skip to contentSkip to conversation

leds: lp55xx: use gpiod_set_value_cansleep

PATCH Applied Stefan Eichenberger 2 participants 2 messages Sep 18, 2023 – Sep 21, 2023 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leds: lp55xx: use gpiod_set_value_cansleep

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
---
 drivers/leds/leds-lp55xx-common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/leds/leds-lp55xx-common.c +2 -2
index 77bb26906ea6e..8e7074f0fee00 100644
@@ -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. */
 	}
 
Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw

Re: (subset) [PATCH] leds: lp55xx: use gpiod_set_value_cansleep

Quoted 6 lines · Stefan Eichenberger

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 [李琼斯]