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

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>

authored by

Philipp Rosenberger and committed by
Linus Walleij
77a4d757 dbd1dad2

+6 -5
+6 -5
drivers/gpio/gpio-mxc.c
··· 324 324 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 325 325 struct mxc_gpio_port *port = gc->private; 326 326 u32 gpio_idx = d->hwirq; 327 + int ret; 327 328 328 329 if (enable) { 329 330 if (port->irq_high && (gpio_idx >= 16)) 330 - enable_irq_wake(port->irq_high); 331 + ret = enable_irq_wake(port->irq_high); 331 332 else 332 - enable_irq_wake(port->irq); 333 + ret = enable_irq_wake(port->irq); 333 334 } else { 334 335 if (port->irq_high && (gpio_idx >= 16)) 335 - disable_irq_wake(port->irq_high); 336 + ret = disable_irq_wake(port->irq_high); 336 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 343 344 static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)