Skip to content

Commit f56d979

Browse files
digetxbrgl
authored andcommitted
gpio: tegra: Properly handle irq_set_irq_wake() error
Technically upstream interrupt controller may fail changing of GPIO's bank wake-state and in this case the GPIO's wake-state shouldn't be changed. Signed-off-by: Dmitry Osipenko <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Tested-by: Thierry Reding <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent fc782e4 commit f56d979

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/gpio/gpio-tegra.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,11 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)
497497
struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d);
498498
unsigned int gpio = d->hwirq;
499499
u32 port, bit, mask;
500+
int err;
501+
502+
err = irq_set_irq_wake(bank->irq, enable);
503+
if (err)
504+
return err;
500505

501506
port = GPIO_PORT(gpio);
502507
bit = GPIO_BIT(gpio);
@@ -507,7 +512,7 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)
507512
else
508513
bank->wake_enb[port] &= ~mask;
509514

510-
return irq_set_irq_wake(bank->irq, enable);
515+
return 0;
511516
}
512517
#endif
513518

0 commit comments

Comments
 (0)