Skip to contentSkip to conversation

thermal: exynos: fix ordering in exynos_tmu_remove()

PATCH In review Bartlomiej Zolnierkiewicz 2 participants 2 messages Jul 8, 2014 – Jul 9, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: exynos: fix ordering in exynos_tmu_remove()

It might not be a problem currently but unregister/uninitialize things in the reverse order that they are registered/initialized.

---
 drivers/thermal/samsung/exynos_tmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/samsung/exynos_tmu.c +2 -2
index d7ca9f4..6243ba0 100644
@@ -759,10 +759,10 @@ static int exynos_tmu_remove(struct platform_device *pdev)
 {
 	struct exynos_tmu_data *data = platform_get_drvdata(pdev);
 
-	exynos_tmu_control(pdev, false);
-
 	exynos_unregister_thermal(data->reg_conf);
 
+	exynos_tmu_control(pdev, false);
+
 	clk_unprepare(data->clk);
 	if (!IS_ERR(data->clk_sec))
 		clk_unprepare(data->clk_sec);
Signature · 1 line
1.8.2.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Bartlomiej Zolnierkiewicz

It might not be a problem currently but unregister/uninitialize things in the reverse order that they are registered/initialized.

Changes look fine,

Quoted 29 lines
---
 drivers/thermal/samsung/exynos_tmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/samsung/exynos_tmu.c +2 -3
index d7ca9f4..6243ba0 100644
@@ -759,10 +759,10 @@ static int exynos_tmu_remove(struct platform_device *pdev)
 {
        struct exynos_tmu_data *data = platform_get_drvdata(pdev);
 
-       exynos_tmu_control(pdev, false);
-
        exynos_unregister_thermal(data->reg_conf);
 
+       exynos_tmu_control(pdev, false);
+
        clk_unprepare(data->clk);
        if (!IS_ERR(data->clk_sec))
                clk_unprepare(data->clk_sec);
--

1.8.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html