Skip to content

Commit 52ef6f5

Browse files
metiulekmdlezcano
authored andcommitted
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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20231201095625.301884-5-m.majewski2@samsung.com
1 parent 20009a8 commit 52ef6f5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/thermal/samsung/exynos_tmu.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,9 +1002,17 @@ static int exynos_tmu_probe(struct platform_device *pdev)
10021002
return ret;
10031003
}
10041004
} else {
1005-
if (PTR_ERR(data->regulator) == -EPROBE_DEFER)
1005+
ret = PTR_ERR(data->regulator);
1006+
switch (ret) {
1007+
case -ENODEV:
1008+
break;
1009+
case -EPROBE_DEFER:
10061010
return -EPROBE_DEFER;
1007-
dev_info(&pdev->dev, "Regulator node (vtmu) not found\n");
1011+
default:
1012+
dev_err(&pdev->dev, "Failed to get regulator: %d\n",
1013+
ret);
1014+
return ret;
1015+
}
10081016
}
10091017

10101018
ret = exynos_map_dt_data(pdev);

0 commit comments

Comments
 (0)