aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-07-30 08:38:31 -0400
committerLinus Walleij <linus.walleij@linaro.org>2018-08-06 17:46:55 -0400
commit3a2f335c418fed18fc3e4b3d0ee0955e8b2c5f21 (patch)
tree2e6c68bed1271f51624437f6a2591cf49f74fa63
parentcf2ff877a4eea5f5ad959050284eb93d5d2f803a (diff)
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 <andriy.shevchenko@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/gpio/gpiolib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index bdbfc95793e7..6bfd4e5cc161 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1805,16 +1805,18 @@ static const struct irq_domain_ops gpiochip_domain_ops = {
1805static int gpiochip_irq_reqres(struct irq_data *d) 1805static int gpiochip_irq_reqres(struct irq_data *d)
1806{ 1806{
1807 struct gpio_chip *chip = irq_data_get_irq_chip_data(d); 1807 struct gpio_chip *chip = irq_data_get_irq_chip_data(d);
1808 int ret;
1808 1809
1809 if (!try_module_get(chip->gpiodev->owner)) 1810 if (!try_module_get(chip->gpiodev->owner))
1810 return -ENODEV; 1811 return -ENODEV;
1811 1812
1812 if (gpiochip_lock_as_irq(chip, d->hwirq)) { 1813 ret = gpiochip_lock_as_irq(chip, d->hwirq);
1814 if (ret) {
1813 chip_err(chip, 1815 chip_err(chip,
1814 "unable to lock HW IRQ %lu for IRQ\n", 1816 "unable to lock HW IRQ %lu for IRQ\n",
1815 d->hwirq); 1817 d->hwirq);
1816 module_put(chip->gpiodev->owner); 1818 module_put(chip->gpiodev->owner);
1817 return -EINVAL; 1819 return ret;
1818 } 1820 }
1819 return 0; 1821 return 0;
1820} 1822}