regulator: stm32-pwr: Fix error checking for of_iomap
Subsystems (2)
PATCH 1/1 regulator: stm32-pwr: Fix error checking for of_iomap
of_iomap returns NULL on error.
Signed-off-by Axel Lin <[email protected]>
--- drivers/regulator/stm32-pwr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/stm32-pwr.c +2 -2
@@ -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 -ENODEV ; } config.dev = &pdev->dev;
Signature · 1 line
2.17.1
Mark Brown
maintainerQuoted 1 line · Axel Lin
of_iomapreturns NULL on error.
Someone already sent a patch for this.