]> git.baikalelectronics.ru Git - kernel.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)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 25 May 2020 09:14:36 +0000 (11:14 +0200)
When call function devm_platform_ioremap_resource(), we should use IS_ERR()
to check the return value and return PTR_ERR() if failed.

Fixes: 17634675f9c8 ("drivers: gpio: pxa: use devm_platform_ioremap_resource()")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-pxa.c

index 1361270ecf8ce98370687a11eeec6659009ad6d5..0cb6600b8eeee88e4fc12c837d68c8c5d13a9c53 100644 (file)
@@ -660,8 +660,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)) {