mirror of
https://github.com/torvalds/linux.git
synced 2024-11-13 07:31:45 +00:00
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: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
This commit is contained in:
parent
14d3e74f59
commit
5ad79c20b6
@ -99,7 +99,8 @@ static ssize_t gpio_trig_inverted_store(struct device *dev,
|
|||||||
gpio_data->inverted = inverted;
|
gpio_data->inverted = inverted;
|
||||||
|
|
||||||
/* After inverting, we need to update the LED. */
|
/* 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;
|
return n;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user