mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
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
1 changed files with 2 additions and 0 deletions
|
@ -170,6 +170,8 @@ static ssize_t gpio_trig_gpio_store(struct device *dev,
|
||||||
if (gpio_data->gpio != 0)
|
if (gpio_data->gpio != 0)
|
||||||
free_irq(gpio_to_irq(gpio_data->gpio), led);
|
free_irq(gpio_to_irq(gpio_data->gpio), led);
|
||||||
gpio_data->gpio = gpio;
|
gpio_data->gpio = gpio;
|
||||||
|
/* After changing the GPIO, we need to update the LED. */
|
||||||
|
schedule_work(&gpio_data->work);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret ? ret : n;
|
return ret ? ret : n;
|
||||||
|
|
Loading…
Reference in a new issue