summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-12-02 18:01:01 +0100
committerLinus Walleij <linus.walleij@linaro.org>2017-12-02 22:42:35 +0100
commit4070a53496ec0c94fda1da0773eee2e5a5bd0084 (patch)
treec01e8132d4db732a0e5db254cc82446bba0180f9
parentgpio: aspeed: Add support for reset tolerance (diff)
downloadlinux-4070a53496ec0c94fda1da0773eee2e5a5bd0084.tar.xz
linux-4070a53496ec0c94fda1da0773eee2e5a5bd0084.zip
gpio: ftgpio010: Fix platform_get_irq's error checking
The platform_get_irq() function returns negative if an error occurs. zero or positive number on success. platform_get_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/gpio/gpio-ftgpio010.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-ftgpio010.c b/drivers/gpio/gpio-ftgpio010.c
index 7b3394fdc624..b7a3a2db699b 100644
--- a/drivers/gpio/gpio-ftgpio010.c
+++ b/drivers/gpio/gpio-ftgpio010.c
@@ -176,8 +176,8 @@ static int ftgpio_gpio_probe(struct platform_device *pdev)
return PTR_ERR(g->base);
irq = platform_get_irq(pdev, 0);
- if (!irq)
- return -EINVAL;
+ if (irq <= 0)
+ return irq ? irq : -EINVAL;
ret = bgpio_init(&g->gc, dev, 4,
g->base + GPIO_DATA_IN,