Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 6cdae8173f67 ("regulator: Add support for stm32 power regulators")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Wei Yongjun and committed by
Mark Brown
dc62f951 82f26185

+2 -2
+2 -2
drivers/regulator/stm32-pwr.c
··· 140 140 int i, ret = 0; 141 141 142 142 base = of_iomap(np, 0); 143 - if (IS_ERR(base)) { 143 + if (!base) { 144 144 dev_err(&pdev->dev, "Unable to map IO memory\n"); 145 - return PTR_ERR(base); 145 + return -ENOMEM; 146 146 } 147 147 148 148 config.dev = &pdev->dev;