aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/thermal/exynos_thermal.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index 46568c078dee..055cd60b839f 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -985,12 +985,16 @@ static int exynos_tmu_probe(struct platform_device *pdev)
985 return ret; 985 return ret;
986 } 986 }
987 987
988 data->clk = clk_get(NULL, "tmu_apbif"); 988 data->clk = devm_clk_get(&pdev->dev, "tmu_apbif");
989 if (IS_ERR(data->clk)) { 989 if (IS_ERR(data->clk)) {
990 dev_err(&pdev->dev, "Failed to get clock\n"); 990 dev_err(&pdev->dev, "Failed to get clock\n");
991 return PTR_ERR(data->clk); 991 return PTR_ERR(data->clk);
992 } 992 }
993 993
994 ret = clk_prepare(data->clk);
995 if (ret)
996 return ret;
997
994 if (pdata->type == SOC_ARCH_EXYNOS || 998 if (pdata->type == SOC_ARCH_EXYNOS ||
995 pdata->type == SOC_ARCH_EXYNOS4210) 999 pdata->type == SOC_ARCH_EXYNOS4210)
996 data->soc = pdata->type; 1000 data->soc = pdata->type;
@@ -1046,7 +1050,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
1046 return 0; 1050 return 0;
1047err_clk: 1051err_clk:
1048 platform_set_drvdata(pdev, NULL); 1052 platform_set_drvdata(pdev, NULL);
1049 clk_put(data->clk); 1053 clk_unprepare(data->clk);
1050 return ret; 1054 return ret;
1051} 1055}
1052 1056
@@ -1060,7 +1064,7 @@ static int exynos_tmu_remove(struct platform_device *pdev)
1060 1064
1061 exynos_unregister_thermal(); 1065 exynos_unregister_thermal();
1062 1066
1063 clk_put(data->clk); 1067 clk_unprepare(data->clk);
1064 1068
1065 platform_set_drvdata(pdev, NULL); 1069 platform_set_drvdata(pdev, NULL);
1066 1070