aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/msm_iommu_dev.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/iommu/msm_iommu_dev.c b/drivers/iommu/msm_iommu_dev.c
index 8e8fb079852d..9144a6beed92 100644
--- a/drivers/iommu/msm_iommu_dev.c
+++ b/drivers/iommu/msm_iommu_dev.c
@@ -29,7 +29,6 @@
29 29
30#include <mach/iommu_hw-8xxx.h> 30#include <mach/iommu_hw-8xxx.h>
31#include <mach/iommu.h> 31#include <mach/iommu.h>
32#include <mach/clk.h>
33 32
34struct iommu_ctx_iter_data { 33struct iommu_ctx_iter_data {
35 /* input */ 34 /* input */
@@ -160,7 +159,7 @@ static int msm_iommu_probe(struct platform_device *pdev)
160 goto fail; 159 goto fail;
161 } 160 }
162 161
163 ret = clk_enable(iommu_pclk); 162 ret = clk_prepare_enable(iommu_pclk);
164 if (ret) 163 if (ret)
165 goto fail_enable; 164 goto fail_enable;
166 165
@@ -168,9 +167,9 @@ static int msm_iommu_probe(struct platform_device *pdev)
168 167
169 if (!IS_ERR(iommu_clk)) { 168 if (!IS_ERR(iommu_clk)) {
170 if (clk_get_rate(iommu_clk) == 0) 169 if (clk_get_rate(iommu_clk) == 0)
171 clk_set_min_rate(iommu_clk, 1); 170 clk_set_rate(iommu_clk, 1);
172 171
173 ret = clk_enable(iommu_clk); 172 ret = clk_prepare_enable(iommu_clk);
174 if (ret) { 173 if (ret) {
175 clk_put(iommu_clk); 174 clk_put(iommu_clk);
176 goto fail_pclk; 175 goto fail_pclk;
@@ -261,7 +260,7 @@ fail_clk:
261 clk_put(iommu_clk); 260 clk_put(iommu_clk);
262 } 261 }
263fail_pclk: 262fail_pclk:
264 clk_disable(iommu_pclk); 263 clk_disable_unprepare(iommu_pclk);
265fail_enable: 264fail_enable:
266 clk_put(iommu_pclk); 265 clk_put(iommu_pclk);
267fail: 266fail:
@@ -275,8 +274,11 @@ static int msm_iommu_remove(struct platform_device *pdev)
275 274
276 drv = platform_get_drvdata(pdev); 275 drv = platform_get_drvdata(pdev);
277 if (drv) { 276 if (drv) {
278 if (drv->clk) 277 if (drv->clk) {
278 clk_unprepare(drv->clk);
279 clk_put(drv->clk); 279 clk_put(drv->clk);
280 }
281 clk_unprepare(drv->pclk);
280 clk_put(drv->pclk); 282 clk_put(drv->pclk);
281 memset(drv, 0, sizeof(*drv)); 283 memset(drv, 0, sizeof(*drv));
282 kfree(drv); 284 kfree(drv);
@@ -314,14 +316,14 @@ static int msm_iommu_ctx_probe(struct platform_device *pdev)
314 INIT_LIST_HEAD(&ctx_drvdata->attached_elm); 316 INIT_LIST_HEAD(&ctx_drvdata->attached_elm);
315 platform_set_drvdata(pdev, ctx_drvdata); 317 platform_set_drvdata(pdev, ctx_drvdata);
316 318
317 ret = clk_enable(drvdata->pclk); 319 ret = clk_prepare_enable(drvdata->pclk);
318 if (ret) 320 if (ret)
319 goto fail; 321 goto fail;
320 322
321 if (drvdata->clk) { 323 if (drvdata->clk) {
322 ret = clk_enable(drvdata->clk); 324 ret = clk_prepare_enable(drvdata->clk);
323 if (ret) { 325 if (ret) {
324 clk_disable(drvdata->pclk); 326 clk_disable_unprepare(drvdata->pclk);
325 goto fail; 327 goto fail;
326 } 328 }
327 } 329 }