提交 77a4d757 编写于 作者: P Philipp Rosenberger 提交者: Linus Walleij

gpio: gpio-mxc: gpio_set_wake_irq() use proper return values

Errors from enable_irq_wake() in gpio_set_wake_irq() were silently ignored.
Thus led to the problem that gpio_set_wake_irq() always returned
successfully, even if enable_irq_wake() returned an error.
Signed-off-by: NPhilipp Rosenberger <p.rosenberger@linutronix.de>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 dbd1dad2
......@@ -324,20 +324,21 @@ static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
struct mxc_gpio_port *port = gc->private;
u32 gpio_idx = d->hwirq;
int ret;
if (enable) {
if (port->irq_high && (gpio_idx >= 16))
enable_irq_wake(port->irq_high);
ret = enable_irq_wake(port->irq_high);
else
enable_irq_wake(port->irq);
ret = enable_irq_wake(port->irq);
} else {
if (port->irq_high && (gpio_idx >= 16))
disable_irq_wake(port->irq_high);
ret = disable_irq_wake(port->irq_high);
else
disable_irq_wake(port->irq);
ret = disable_irq_wake(port->irq);
}
return 0;
return ret;
}
static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册