diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2017-12-02 18:01:01 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-12-02 22:42:35 +0100 |
commit | 4070a53496ec0c94fda1da0773eee2e5a5bd0084 (patch) | |
tree | c01e8132d4db732a0e5db254cc82446bba0180f9 | |
parent | gpio: aspeed: Add support for reset tolerance (diff) | |
download | linux-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.c | 4 |
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, |