summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-09-06 16:33:48 +0300
committerLinus Walleij <linus.walleij@linaro.org>2018-09-10 08:48:24 +0200
commitf6d9af4770995d1f58be57139bce7974868231e8 (patch)
tree97184175c3eb661c6d2354e9ddda2adae735ec90 /drivers/gpio
parentf40f73075c59b0d847eadbada9ec5c0d0142b107 (diff)
gpio: ep93xx: fix test for end of loop
The problem is that if port == ARRAY_SIZE() and "gc == &epg->gc[port]" then that should be treated as invalid. Fixes: fd935fc421e7 ("gpio: ep93xx: Do not pingpong irq numbers") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-ep93xx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
index dd22ea19c3ed..71728d6e0bca 100644
--- a/drivers/gpio/gpio-ep93xx.c
+++ b/drivers/gpio/gpio-ep93xx.c
@@ -80,7 +80,7 @@ static int ep93xx_gpio_port(struct gpio_chip *gc)
port++;
/* This should not happen but is there as a last safeguard */
- if (gc != &epg->gc[port]) {
+ if (port == ARRAY_SIZE(epg->gc)) {
pr_crit("can't find the GPIO port\n");
return 0;
}