Use clk_prepare_enable api to enable tmu internal hardware clock flag on, use clk_disable_unprepare to disable the clock. Cc: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx> Signed-off-by: Anand Moon <linux.amoon@xxxxxxxxx> --- v1: split te changes and improve the commit message. --- drivers/thermal/samsung/exynos_tmu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index f4ab4c5b4b62..75b3afadb5be 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1054,14 +1054,14 @@ static int exynos_tmu_probe(struct platform_device *pdev) goto err_sensor; } } else { - ret = clk_prepare(data->clk_sec); + ret = clk_prepare_enable(data->clk_sec); if (ret) { dev_err(&pdev->dev, "Failed to get clock\n"); goto err_sensor; } } - ret = clk_prepare(data->clk); + ret = clk_prepare_enable(data->clk); if (ret) { dev_err(&pdev->dev, "Failed to get clock\n"); goto err_clk_sec; @@ -1122,10 +1122,10 @@ static int exynos_tmu_probe(struct platform_device *pdev) err_sclk: clk_disable_unprepare(data->sclk); err_clk: - clk_unprepare(data->clk); + clk_disable_unprepare(data->clk); err_clk_sec: if (!IS_ERR(data->clk_sec)) - clk_unprepare(data->clk_sec); + clk_disable_unprepare(data->clk_sec); err_sensor: if (!IS_ERR(data->regulator)) regulator_disable(data->regulator); @@ -1142,9 +1142,9 @@ static int exynos_tmu_remove(struct platform_device *pdev) exynos_tmu_control(pdev, false); clk_disable_unprepare(data->sclk); - clk_unprepare(data->clk); + clk_disable_unprepare(data->clk); if (!IS_ERR(data->clk_sec)) - clk_unprepare(data->clk_sec); + clk_disable_unprepare(data->clk_sec); if (!IS_ERR(data->regulator)) regulator_disable(data->regulator); -- 2.36.1