]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpio: dwapb: Don't shadow error code of gpiochip_lock_as_irq()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 30 Jul 2018 12:38:33 +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.

Cc: Hoan Tran <hotran@apm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-dwapb.c

index 7a2de3de65719a6de3177c07e731a0f6f62d708d..28da700f5f5258f54117dee459904d2140d0d411 100644 (file)
@@ -255,11 +255,13 @@ static int dwapb_irq_reqres(struct irq_data *d)
        struct irq_chip_generic *igc = irq_data_get_irq_chip_data(d);
        struct dwapb_gpio *gpio = igc->private;
        struct gpio_chip *gc = &gpio->ports[0].gc;
+       int ret;
 
-       if (gpiochip_lock_as_irq(gc, irqd_to_hwirq(d))) {
+       ret = gpiochip_lock_as_irq(gc, irqd_to_hwirq(d));
+       if (ret) {
                dev_err(gpio->dev, "unable to lock HW IRQ %lu for IRQ\n",
                        irqd_to_hwirq(d));
-               return -EINVAL;
+               return ret;
        }
        return 0;
 }