Commit 71afe3cb authored by Jan Kiszka's avatar Jan Kiszka Committed by Jacek Anaszewski

leds: trigger: gpio: Refresh LED state after GPIO change

The new GPIO may have a different state than the old one.
Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarJacek Anaszewski <jacek.anaszewski@gmail.com>
parent 7678da8e
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment