summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2016-09-15 03:30:32 +0200
committerLinus Walleij <linus.walleij@linaro.org>2016-09-15 14:23:40 +0200
commit7f8b96570291def5104cec6f68bae09bd55b691a (patch)
tree62102f1ec1cdeef6881a5125c1b9865a5cc9339c /drivers/gpio
parentgpio: don't include module.h in shared driver header (diff)
downloadlinux-7f8b96570291def5104cec6f68bae09bd55b691a.tar.xz
linux-7f8b96570291def5104cec6f68bae09bd55b691a.zip
gpio: aspeed: fix return value check in aspeed_gpio_probe()
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-aspeed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
index 9f7266e05f0a..8aa340677f65 100644
--- a/drivers/gpio/gpio-aspeed.c
+++ b/drivers/gpio/gpio-aspeed.c
@@ -413,8 +413,8 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
return -ENXIO;
gpio->base = devm_ioremap_resource(&pdev->dev, res);
- if (!gpio->base)
- return -ENOMEM;
+ if (IS_ERR(gpio->base))
+ return PTR_ERR(gpio->base);
spin_lock_init(&gpio->lock);