From: Philipp Rosenberger Date: Wed, 12 Jul 2017 08:36:39 +0000 (+0200) Subject: gpio: gpio-mxc: Fix: higher 16 GPIOs usable as wake source X-Git-Tag: v5.15~10719^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc9269f89643c8684eb516ab3cd1cb49385f83fa;p=platform%2Fkernel%2Flinux-starfive.git gpio: gpio-mxc: Fix: higher 16 GPIOs usable as wake source In the function gpio_set_wake_irq(), port->irq_high is only checked for zero. As platform_get_irq() returns a value less then zero if no interrupt was found, any gpio >= 16 was handled like an irq_high interrupt was available. On iMX27 for example no high interrupt is available. This lead to the problem that only some gpios (the lower 16) were useable as wake sources. Signed-off-by: Philipp Rosenberger Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index 3abea3f..92692251 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -424,6 +424,9 @@ static int mxc_gpio_probe(struct platform_device *pdev) return PTR_ERR(port->base); port->irq_high = platform_get_irq(pdev, 1); + if (port->irq_high < 0) + port->irq_high = 0; + port->irq = platform_get_irq(pdev, 0); if (port->irq < 0) return port->irq;