summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/pinctrl/nuvoton/pinctrl-wpcm450.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
index f7565ce66651..0dbeb91f0bf2 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
@@ -1019,8 +1019,9 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
int ret;
pctrl->gpio_base = devm_platform_ioremap_resource(pdev, 0);
- if (!pctrl->gpio_base)
- return dev_err_probe(dev, -ENOMEM, "Resource fail for GPIO controller\n");
+ if (IS_ERR(pctrl->gpio_base))
+ return dev_err_probe(dev, PTR_ERR(pctrl->gpio_base),
+ "Resource fail for GPIO controller\n");
device_for_each_child_node(dev, child) {
void __iomem *dat = NULL;