]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gpio: pxa: Fix return value of pxa_gpio_probe()
authorTiezhu Yang <yangtiezhu@loongson.cn>
Fri, 22 May 2020 04:12:19 +0000 (12:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jun 2020 06:23:18 +0000 (08:23 +0200)
[ Upstream commit 558ab2e8155e5f42ca0a6407957cd4173dc166cc ]

When call function devm_platform_ioremap_resource(), we should use IS_ERR()
to check the return value and return PTR_ERR() if failed.

Fixes: 542c25b7a209 ("drivers: gpio: pxa: use devm_platform_ioremap_resource()")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-pxa.c

index 9888b62f37afbadf0ee9d022c4e4ceb0faddd99e..432c487f77b49e4761705637e28be8e17535654a 100644 (file)
@@ -663,8 +663,8 @@ static int pxa_gpio_probe(struct platform_device *pdev)
        pchip->irq1 = irq1;
 
        gpio_reg_base = devm_platform_ioremap_resource(pdev, 0);
-       if (!gpio_reg_base)
-               return -EINVAL;
+       if (IS_ERR(gpio_reg_base))
+               return PTR_ERR(gpio_reg_base);
 
        clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(clk)) {