Commit dc62f951 authored by Wei Yongjun's avatar Wei Yongjun Committed by Mark Brown

regulator: stm32-pwr: Fix return value check in stm32_pwr_regulator_probe()

In case of error, the function of_iomap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: 6cdae817 ("regulator: Add support for stm32 power regulators")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 82f26185
......@@ -140,9 +140,9 @@ static int stm32_pwr_regulator_probe(struct platform_device *pdev)
int i, ret = 0;
base = of_iomap(np, 0);
if (IS_ERR(base)) {
if (!base) {
dev_err(&pdev->dev, "Unable to map IO memory\n");
return PTR_ERR(base);
return -ENOMEM;
}
config.dev = &pdev->dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment