Commit 52ef6f56 authored by Mateusz Majewski's avatar Mateusz Majewski Committed by Daniel Lezcano

thermal/drivers/exynos: Handle devm_regulator_get_optional return value correctly

Currently, if regulator is required in the SoC, but
devm_regulator_get_optional fails for whatever reason, the execution
will proceed without propagating the error. Meanwhile there is no
reason to output the error in case of -ENODEV.
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: default avatarMateusz Majewski <m.majewski2@samsung.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20231201095625.301884-5-m.majewski2@samsung.com
parent 20009a81
...@@ -1002,9 +1002,17 @@ static int exynos_tmu_probe(struct platform_device *pdev) ...@@ -1002,9 +1002,17 @@ static int exynos_tmu_probe(struct platform_device *pdev)
return ret; return ret;
} }
} else { } else {
if (PTR_ERR(data->regulator) == -EPROBE_DEFER) ret = PTR_ERR(data->regulator);
switch (ret) {
case -ENODEV:
break;
case -EPROBE_DEFER:
return -EPROBE_DEFER; return -EPROBE_DEFER;
dev_info(&pdev->dev, "Regulator node (vtmu) not found\n"); default:
dev_err(&pdev->dev, "Failed to get regulator: %d\n",
ret);
return ret;
}
} }
ret = exynos_map_dt_data(pdev); ret = exynos_map_dt_data(pdev);
......
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