summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-tegra.c
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2019-12-15 21:30:46 +0300
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2019-12-20 10:58:06 +0100
commitf56d979cc58e9a361e0bf1b764fdadc85ee2d7c8 (patch)
tree0e8e3514d0990d6bb2e804f3ed2794f044c3713e /drivers/gpio/gpio-tegra.c
parentfc782e47e601843163034a68c29ea1abe2578570 (diff)
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 <digetx@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Tested-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/gpio/gpio-tegra.c')
-rw-r--r--drivers/gpio/gpio-tegra.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index f6a382fbd12d..4790dfec7758 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -497,6 +497,11 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)
struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d);
unsigned int gpio = d->hwirq;
u32 port, bit, mask;
+ int err;
+
+ err = irq_set_irq_wake(bank->irq, enable);
+ if (err)
+ return err;
port = GPIO_PORT(gpio);
bit = GPIO_BIT(gpio);
@@ -507,7 +512,7 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)
else
bank->wake_enb[port] &= ~mask;
- return irq_set_irq_wake(bank->irq, enable);
+ return 0;
}
#endif