Commit 5ad79c20 authored by Jan Kiszka's avatar Jan Kiszka Committed by Pavel Machek

leds: trigger: gpio: Avoid warning on update of inverted

If the GPIO has not been configured yet, writing to inverted will raise
a kernel warning.
Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent 14d3e74f
......@@ -99,7 +99,8 @@ static ssize_t gpio_trig_inverted_store(struct device *dev,
gpio_data->inverted = inverted;
/* After inverting, we need to update the LED. */
gpio_trig_irq(0, led);
if (gpio_is_valid(gpio_data->gpio))
gpio_trig_irq(0, led);
return 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