From: Andy Shevchenko Date: Mon, 30 Jul 2018 12:38:31 +0000 (+0300) Subject: gpiolib: Don't shadow error code of gpiochip_lock_as_irq() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3a2f335c418fed18fc3e4b3d0ee0955e8b2c5f21;p=linux.git gpiolib: Don't shadow error code of gpiochip_lock_as_irq() 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 Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index bdbfc95793e73..6bfd4e5cc1619 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1805,16 +1805,18 @@ static const struct irq_domain_ops gpiochip_domain_ops = { static int gpiochip_irq_reqres(struct irq_data *d) { struct gpio_chip *chip = irq_data_get_irq_chip_data(d); + int ret; if (!try_module_get(chip->gpiodev->owner)) return -ENODEV; - if (gpiochip_lock_as_irq(chip, d->hwirq)) { + ret = gpiochip_lock_as_irq(chip, d->hwirq); + if (ret) { chip_err(chip, "unable to lock HW IRQ %lu for IRQ\n", d->hwirq); module_put(chip->gpiodev->owner); - return -EINVAL; + return ret; } return 0; }