summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-mxc.c
diff options
context:
space:
mode:
authorPhilipp Rosenberger <p.rosenberger@linutronix.de>2017-07-12 04:36:40 -0400
committerLinus Walleij <linus.walleij@linaro.org>2017-08-14 09:01:12 -0400
commit77a4d757195fcf40f5cc0eaa1b6f5eb9a4d23851 (patch)
tree1c89ea6639180e8fdaaefa672b55536561ea3489 /drivers/gpio/gpio-mxc.c
parentdbd1dad2ab8ffca57e0aa386df0d7ec621c26ca8 (diff)
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: Philipp Rosenberger <p.rosenberger@linutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-mxc.c')
-rw-r--r--drivers/gpio/gpio-mxc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 92692251ade1..3dcd990f416e 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -324,20 +324,21 @@ static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
324 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 324 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
325 struct mxc_gpio_port *port = gc->private; 325 struct mxc_gpio_port *port = gc->private;
326 u32 gpio_idx = d->hwirq; 326 u32 gpio_idx = d->hwirq;
327 int ret;
327 328
328 if (enable) { 329 if (enable) {
329 if (port->irq_high && (gpio_idx >= 16)) 330 if (port->irq_high && (gpio_idx >= 16))
330 enable_irq_wake(port->irq_high); 331 ret = enable_irq_wake(port->irq_high);
331 else 332 else
332 enable_irq_wake(port->irq); 333 ret = enable_irq_wake(port->irq);
333 } else { 334 } else {
334 if (port->irq_high && (gpio_idx >= 16)) 335 if (port->irq_high && (gpio_idx >= 16))
335 disable_irq_wake(port->irq_high); 336 ret = disable_irq_wake(port->irq_high);
336 else 337 else
337 disable_irq_wake(port->irq); 338 ret = disable_irq_wake(port->irq);
338 } 339 }
339 340
340 return 0; 341 return ret;
341} 342}
342 343
343static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base) 344static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)