diff options
author | Stefan Eichenberger <eichest@gmail.com> | 2023-09-18 17:32:38 +0300 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-11-01 14:28:42 +0300 |
commit | 7c977019c53ed2689e5509ebd1d89a424cf3d313 (patch) | |
tree | 5f592cb84243bb671f9ec57da0561ac950a54bdf /drivers/leds | |
parent | e3c9d952139c1eb42f35bdcdcb85a66a72587b34 (diff) | |
download | linux-7c977019c53ed2689e5509ebd1d89a424cf3d313.tar.xz |
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
Signed-off-by: Stefan Eichenberger <eichest@gmail.com>
Link: https://lore.kernel.org/r/20230918143238.75600-1-eichest@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-lp55xx-common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index 77bb26906ea6..8e7074f0fee0 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. */ } |