[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220515064126.1424-3-linux.amoon@gmail.com>
Date: Sun, 15 May 2022 06:41:19 +0000
From: Anand Moon <linux.amoon@...il.com>
To: 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>,
linux-pm@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Anand Moon <linux.amoon@...il.com>
Subject: [PATCHv2 2/6] thermal: exynos: Reorder the gpu clock initialization for exynos5420 SoC
Reorder the tmu_gpu clock initialization for exynos5422 SoC.
Cc: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
Signed-off-by: Anand Moon <linux.amoon@...il.com>
---
v1: split the changes and improve the commit messages
---
drivers/thermal/samsung/exynos_tmu.c | 43 ++++++++++++++--------------
1 file changed, 21 insertions(+), 22 deletions(-)
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 75b3afadb5be..1ef90dc52c08 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -1044,42 +1044,41 @@ static int exynos_tmu_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "Failed to get clock\n");
ret = PTR_ERR(data->clk);
goto err_sensor;
- }
-
- data->clk_sec = devm_clk_get(&pdev->dev, "tmu_triminfo_apbif");
- if (IS_ERR(data->clk_sec)) {
- if (data->soc == SOC_ARCH_EXYNOS5420_TRIMINFO) {
- dev_err(&pdev->dev, "Failed to get triminfo clock\n");
- ret = PTR_ERR(data->clk_sec);
- goto err_sensor;
- }
} else {
- ret = clk_prepare_enable(data->clk_sec);
+ ret = clk_prepare_enable(data->clk);
if (ret) {
dev_err(&pdev->dev, "Failed to get clock\n");
goto err_sensor;
}
}
- ret = clk_prepare_enable(data->clk);
- if (ret) {
- dev_err(&pdev->dev, "Failed to get clock\n");
- goto err_clk_sec;
- }
-
switch (data->soc) {
+ case SOC_ARCH_EXYNOS5420_TRIMINFO:
+ data->clk_sec = devm_clk_get(&pdev->dev, "tmu_triminfo_apbif");
+ if (IS_ERR(data->clk_sec)) {
+ dev_err(&pdev->dev, "Failed to get triminfo clock\n");
+ ret = PTR_ERR(data->clk_sec);
+ goto err_clk_apbif;
+ } else {
+ ret = clk_prepare_enable(data->clk_sec);
+ if (ret) {
+ dev_err(&pdev->dev, "Failed to get clock\n");
+ goto err_clk_apbif;
+ }
+ }
+ break;
case SOC_ARCH_EXYNOS5433:
case SOC_ARCH_EXYNOS7:
data->sclk = devm_clk_get(&pdev->dev, "tmu_sclk");
if (IS_ERR(data->sclk)) {
dev_err(&pdev->dev, "Failed to get sclk\n");
ret = PTR_ERR(data->sclk);
- goto err_clk;
+ goto err_clk_sec;
} else {
ret = clk_prepare_enable(data->sclk);
if (ret) {
dev_err(&pdev->dev, "Failed to enable sclk\n");
- goto err_clk;
+ goto err_clk_sec;
}
}
break;
@@ -1119,13 +1118,13 @@ static int exynos_tmu_probe(struct platform_device *pdev)
err_thermal:
thermal_zone_of_sensor_unregister(&pdev->dev, data->tzd);
-err_sclk:
- clk_disable_unprepare(data->sclk);
-err_clk:
- clk_disable_unprepare(data->clk);
err_clk_sec:
if (!IS_ERR(data->clk_sec))
clk_disable_unprepare(data->clk_sec);
+err_sclk:
+ clk_disable_unprepare(data->sclk);
+err_clk_apbif:
+ clk_disable_unprepare(data->clk);
err_sensor:
if (!IS_ERR(data->regulator))
regulator_disable(data->regulator);
--
2.36.1
Powered by blists - more mailing lists