diff options
author | Tiezhu Yang <yangtiezhu@loongson.cn> | 2020-05-22 07:12:19 +0300 |
---|---|---|
committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2020-05-25 12:14:36 +0300 |
commit | 558ab2e8155e5f42ca0a6407957cd4173dc166cc (patch) | |
tree | 38caa4c44ef4119e3808681aaa4be515ab67214f /drivers/gpio/gpio-pxa.c | |
parent | e6862430fa5ef557d40c221c7f9bb3beb5feaca4 (diff) | |
download | linux-558ab2e8155e5f42ca0a6407957cd4173dc166cc.tar.xz |
gpio: pxa: Fix return value of pxa_gpio_probe()
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>
Diffstat (limited to 'drivers/gpio/gpio-pxa.c')
-rw-r--r-- | drivers/gpio/gpio-pxa.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index 1361270ecf8c..0cb6600b8eee 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -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)) { |