mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02: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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user