[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231003111638.241542-5-m.majewski2@samsung.com>
Date: Tue, 3 Oct 2023 13:16:30 +0200
From: Mateusz Majewski <m.majewski2@...sung.com>
To: linux-pm@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Mateusz Majewski <m.majewski2@...sung.com>,
Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Amit Kucheria <amitk@...nel.org>,
Zhang Rui <rui.zhang@...el.com>,
Alim Akhtar <alim.akhtar@...sung.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Marek Szyprowski <m.szyprowski@...sung.com>
Subject: [PATCH v3 4/8] thermal: 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.
Signed-off-by: Mateusz Majewski <m.majewski2@...sung.com>
---
drivers/thermal/samsung/exynos_tmu.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 0e970638193d..6070b03cff9d 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -1002,9 +1002,17 @@ static int exynos_tmu_probe(struct platform_device *pdev)
return ret;
}
} else {
- if (PTR_ERR(data->regulator) == -EPROBE_DEFER)
+ ret = PTR_ERR(data->regulator);
+ switch (ret) {
+ case -ENODEV:
+ break;
+ case -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);
--
2.42.0
Powered by blists - more mailing lists