diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2017-05-26 15:17:46 +0200 |
---|---|---|
committer | Jacek Anaszewski <jacek.anaszewski@gmail.com> | 2017-05-29 21:55:04 +0200 |
commit | 71afe3cb1e8fdf89556047e03bcbcd731f1ab108 (patch) | |
tree | 3f977279e5487e6a8d3cb990dfe546910d0ddbec /drivers/leds | |
parent | 7678da8ee6dec14eda83672b319b2f7b3b2cd22e (diff) | |
download | lwn-71afe3cb1e8fdf89556047e03bcbcd731f1ab108.tar.gz lwn-71afe3cb1e8fdf89556047e03bcbcd731f1ab108.zip |
leds: trigger: gpio: Refresh LED state after GPIO change
The new GPIO may have a different state than the old one.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/trigger/ledtrig-gpio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/leds/trigger/ledtrig-gpio.c b/drivers/leds/trigger/ledtrig-gpio.c index 51288a45fbcb..93d6b82e6437 100644 --- a/drivers/leds/trigger/ledtrig-gpio.c +++ b/drivers/leds/trigger/ledtrig-gpio.c @@ -170,6 +170,8 @@ static ssize_t gpio_trig_gpio_store(struct device *dev, if (gpio_data->gpio != 0) free_irq(gpio_to_irq(gpio_data->gpio), led); gpio_data->gpio = gpio; + /* After changing the GPIO, we need to update the LED. */ + schedule_work(&gpio_data->work); } return ret ? ret : n; |