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>
This commit is contained in:
parent
7678da8ee6
commit
71afe3cb1e
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue