pinctrl: Fix return value check in amd_gpio_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Sat, 6 Feb 2016 14:56:36 +0000 (22:56 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 15 Feb 2016 18:42:41 +0000 (19:42 +0100)
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 <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-amd.c

index 6574494..5c025f5 100644 (file)
@@ -753,8 +753,8 @@ static int amd_gpio_probe(struct platform_device *pdev)
 
        gpio_dev->base = devm_ioremap_nocache(&pdev->dev, res->start,
                                                resource_size(res));
-       if (IS_ERR(gpio_dev->base))
-               return PTR_ERR(gpio_dev->base);
+       if (!gpio_dev->base)
+               return -ENOMEM;
 
        irq_base = platform_get_irq(pdev, 0);
        if (irq_base < 0) {