Commit 2a16279c authored by Sachin Kamat's avatar Sachin Kamat Committed by Zhang Rui

Thermal: exynos: Add clk_{un}prepare APIs

clk_{un}prepare APIs are required to migrate to common
clock framework. While at it convert to use devm_clk_get as
it removes some cleanup code.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
Acked-by: default avatarEduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 3912a677
...@@ -985,12 +985,16 @@ static int exynos_tmu_probe(struct platform_device *pdev) ...@@ -985,12 +985,16 @@ static int exynos_tmu_probe(struct platform_device *pdev)
return ret; return ret;
} }
data->clk = clk_get(NULL, "tmu_apbif"); data->clk = devm_clk_get(&pdev->dev, "tmu_apbif");
if (IS_ERR(data->clk)) { if (IS_ERR(data->clk)) {
dev_err(&pdev->dev, "Failed to get clock\n"); dev_err(&pdev->dev, "Failed to get clock\n");
return PTR_ERR(data->clk); return PTR_ERR(data->clk);
} }
ret = clk_prepare(data->clk);
if (ret)
return ret;
if (pdata->type == SOC_ARCH_EXYNOS || if (pdata->type == SOC_ARCH_EXYNOS ||
pdata->type == SOC_ARCH_EXYNOS4210) pdata->type == SOC_ARCH_EXYNOS4210)
data->soc = pdata->type; data->soc = pdata->type;
...@@ -1046,7 +1050,7 @@ static int exynos_tmu_probe(struct platform_device *pdev) ...@@ -1046,7 +1050,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
return 0; return 0;
err_clk: err_clk:
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
clk_put(data->clk); clk_unprepare(data->clk);
return ret; return ret;
} }
...@@ -1060,7 +1064,7 @@ static int exynos_tmu_remove(struct platform_device *pdev) ...@@ -1060,7 +1064,7 @@ static int exynos_tmu_remove(struct platform_device *pdev)
exynos_unregister_thermal(); exynos_unregister_thermal();
clk_put(data->clk); clk_unprepare(data->clk);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment