Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: vr41xx: Bail out on gpiochip_lock_as_irq() error

gpiochip_lock_as_irq() may return a few error codes,
bail out if it fails with corresponding returned code.

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

authored by

Andy Shevchenko and committed by
Linus Walleij
f8ad8aa5 d124339d

+7 -1
+7 -1
drivers/gpio/gpio-vr41xx.c
··· 138 138 139 139 static unsigned int startup_giuint(struct irq_data *data) 140 140 { 141 - if (gpiochip_lock_as_irq(&vr41xx_gpio_chip, data->hwirq)) 141 + int ret; 142 + 143 + ret = gpiochip_lock_as_irq(&vr41xx_gpio_chip, irqd_to_hwirq(data)); 144 + if (ret) { 142 145 dev_err(vr41xx_gpio_chip.parent, 143 146 "unable to lock HW IRQ %lu for IRQ\n", 144 147 data->hwirq); 148 + return ret; 149 + } 150 + 145 151 /* Satisfy the .enable semantics by unmasking the line */ 146 152 unmask_giuint_low(data); 147 153 return 0;