linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sachin Kamat <sachin.kamat@linaro.org>
To: linux-pm@vger.kernel.org
Cc: rui.zhang@intel.com, eduardo.valentin@ti.com,
	sachin.kamat@linaro.org, kgene.kim@samsung.com,
	patches@linaro.org, Amit Daniel Kachhap <amit.daniel@samsung.com>
Subject: [PATCH 1/2] Thermal: exynos: Add clk_{un}prepare APIs
Date: Thu, 18 Apr 2013 17:07:58 +0530	[thread overview]
Message-ID: <1366285079-10395-1-git-send-email-sachin.kamat@linaro.org> (raw)

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: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
---
 drivers/thermal/exynos_thermal.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index e34d842..9df96e5 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -937,12 +937,16 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	data->clk = clk_get(NULL, "tmu_apbif");
+	data->clk = devm_clk_get(&pdev->dev, "tmu_apbif");
 	if (IS_ERR(data->clk)) {
 		dev_err(&pdev->dev, "Failed to get clock\n");
 		return  PTR_ERR(data->clk);
 	}
 
+	ret = clk_prepare(data->clk);
+	if (ret)
+		return ret;
+
 	if (pdata->type == SOC_ARCH_EXYNOS ||
 				pdata->type == SOC_ARCH_EXYNOS4210)
 		data->soc = pdata->type;
@@ -994,7 +998,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 	return 0;
 err_clk:
 	platform_set_drvdata(pdev, NULL);
-	clk_put(data->clk);
+	clk_unprepare(data->clk);
 	return ret;
 }
 
@@ -1006,7 +1010,7 @@ static int exynos_tmu_remove(struct platform_device *pdev)
 
 	exynos_unregister_thermal();
 
-	clk_put(data->clk);
+	clk_unprepare(data->clk);
 
 	platform_set_drvdata(pdev, NULL);
 
-- 
1.7.9.5


             reply	other threads:[~2013-04-18 11:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18 11:37 Sachin Kamat [this message]
2013-04-18 11:37 ` [PATCH 2/2] Thermal: exynos: Add compatible string for exynos4412 Sachin Kamat
2013-04-22 18:27   ` Eduardo Valentin
2013-04-22 18:14 ` [PATCH 1/2] Thermal: exynos: Add clk_{un}prepare APIs Sachin Kamat
2013-04-22 18:25 ` Eduardo Valentin
2013-04-23  3:38   ` Sachin Kamat
2013-04-23 12:44     ` Eduardo Valentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366285079-10395-1-git-send-email-sachin.kamat@linaro.org \
    --to=sachin.kamat@linaro.org \
    --cc=amit.daniel@samsung.com \
    --cc=eduardo.valentin@ti.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).