From: Wei Yongjun Date: Thu, 11 Sep 2014 23:12:14 +0000 (+0800) Subject: gpio: Fix return value check in xgene_gpio_probe() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4f51b91335a63b2672a0f21fd13a684c8e35c4e8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git gpio: Fix return value check in xgene_gpio_probe() In case of error, the function devm_ioremap_nocache() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Reviewed-by: Alexandre Courbot Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c index f1944d496c3b..150e7f1c5ae8 100644 --- a/drivers/gpio/gpio-xgene.c +++ b/drivers/gpio/gpio-xgene.c @@ -182,8 +182,8 @@ static int xgene_gpio_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); gpio->base = devm_ioremap_nocache(&pdev->dev, res->start, resource_size(res)); - if (IS_ERR(gpio->base)) { - err = PTR_ERR(gpio->base); + if (!gpio->base) { + err = -ENOMEM; goto err; }