提交 f8ad8aa5 编写于 作者: A Andy Shevchenko 提交者: Linus Walleij

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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 d124339d
...@@ -138,10 +138,16 @@ static void unmask_giuint_low(struct irq_data *d) ...@@ -138,10 +138,16 @@ static void unmask_giuint_low(struct irq_data *d)
static unsigned int startup_giuint(struct irq_data *data) static unsigned int startup_giuint(struct irq_data *data)
{ {
if (gpiochip_lock_as_irq(&vr41xx_gpio_chip, data->hwirq)) int ret;
ret = gpiochip_lock_as_irq(&vr41xx_gpio_chip, irqd_to_hwirq(data));
if (ret) {
dev_err(vr41xx_gpio_chip.parent, dev_err(vr41xx_gpio_chip.parent,
"unable to lock HW IRQ %lu for IRQ\n", "unable to lock HW IRQ %lu for IRQ\n",
data->hwirq); data->hwirq);
return ret;
}
/* Satisfy the .enable semantics by unmasking the line */ /* Satisfy the .enable semantics by unmasking the line */
unmask_giuint_low(data); unmask_giuint_low(data);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册