Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;