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

gpio: pcf857x: Simpify wake-up handling

Unlike gpio_rcar_irq_set_wake(), which this solution was based on,
pcf857x_irq_set_wake() does not need to do anything else than calling
irq_set_irq_wake() for the upstream interrupt controller. Hence there
is no reason for making this call conditional, and no longer a need for
keeping a copy of the interrupt number that also serves as a flag.

Just propagate irq_set_irq_wake() to the upstream interrupt controller,
using the original interrupt number.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Geert Uytterhoeven and committed by
Linus Walleij
7f2f787c 92de6bc3

+1 -14
+1 -14
drivers/gpio/gpio-pcf857x.c
··· 88 88 struct mutex lock; /* protect 'out' */ 89 89 unsigned out; /* software latch */ 90 90 unsigned status; /* current status */ 91 - unsigned int irq_parent; 92 91 unsigned irq_enabled; /* enabled irqs */ 93 92 94 93 int (*write)(struct i2c_client *client, unsigned data); ··· 209 210 { 210 211 struct pcf857x *gpio = irq_data_get_irq_chip_data(data); 211 212 212 - int error = 0; 213 - 214 - if (gpio->irq_parent) { 215 - error = irq_set_irq_wake(gpio->irq_parent, on); 216 - if (error) { 217 - dev_dbg(&gpio->client->dev, 218 - "irq %u doesn't support irq_set_wake\n", 219 - gpio->irq_parent); 220 - gpio->irq_parent = 0; 221 - } 222 - } 223 - return error; 213 + return irq_set_irq_wake(gpio->client->irq, on); 224 214 } 225 215 226 216 static void pcf857x_irq_enable(struct irq_data *data) ··· 382 394 383 395 gpiochip_set_nested_irqchip(&gpio->chip, &pcf857x_irq_chip, 384 396 client->irq); 385 - gpio->irq_parent = client->irq; 386 397 } 387 398 388 399 /* Let platform code set up the GPIOs and their users.