Skip to content

Commit

Permalink
gpio: pxa: Fix return value of pxa_gpio_probe()
Browse files Browse the repository at this point in the history
When call function devm_platform_ioremap_resource(), we should use IS_ERR()
to check the return value and return PTR_ERR() if failed.

Fixes: 542c25b ("drivers: gpio: pxa: use devm_platform_ioremap_resource()")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
  • Loading branch information
Tiezhu Yang authored and Bartosz Golaszewski committed May 25, 2020
1 parent e686243 commit 558ab2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpio/gpio-pxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 558ab2e

Please sign in to comment.