From: Wei Yongjun Date: Thu, 15 Sep 2016 01:30:32 +0000 (+0000) Subject: gpio: aspeed: fix return value check in aspeed_gpio_probe() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7f8b96570291def5104cec6f68bae09bd55b691a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Joel Stanley Signed-off-by: Linus Walleij --- 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);