提交 71afe3cb 编写于 作者: J Jan Kiszka 提交者: 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: NJan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: NJacek Anaszewski <jacek.anaszewski@gmail.com>
上级 7678da8e
...@@ -170,6 +170,8 @@ static ssize_t gpio_trig_gpio_store(struct device *dev, ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册