gpio: em: Don't shadow error code of gpiochip_lock_as_irq()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 30 Jul 2018 12:38:34 +0000 (15:38 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 6 Aug 2018 21:46:55 +0000 (23:46 +0200)
gpiochip_lock_as_irq() may return a few error codes,
do not shadow them by -EINVAL and let caller to decide.

No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-em.c

index 2b466b80e70ac0745747f26af76cb74a75c889ff..982e699a5b816582034719737b2892455ce538f0 100644 (file)
@@ -101,12 +101,14 @@ static void em_gio_irq_enable(struct irq_data *d)
 static int em_gio_irq_reqres(struct irq_data *d)
 {
        struct em_gio_priv *p = irq_data_get_irq_chip_data(d);
+       int ret;
 
-       if (gpiochip_lock_as_irq(&p->gpio_chip, irqd_to_hwirq(d))) {
+       ret = gpiochip_lock_as_irq(&p->gpio_chip, irqd_to_hwirq(d));
+       if (ret) {
                dev_err(p->gpio_chip.parent,
                        "unable to lock HW IRQ %lu for IRQ\n",
                        irqd_to_hwirq(d));
-               return -EINVAL;
+               return ret;
        }
        return 0;
 }