mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +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
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue