diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-05-31 03:00:58 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-05-31 03:00:58 -0400 |
commit | 1222de7c415cfa70f441f836588fd79a3334d4fe (patch) | |
tree | adb1ff03eee4b2c9955ab11664548a529f6d2bc8 | |
parent | db7eba292e913390fa881272bfbc3da0a5380513 (diff) | |
parent | 5c2de44417523385010b529599a2b30f290831a3 (diff) |
Merge branch 'sh/runtime-pm-misery' into sh-fixes-for-linus
-rw-r--r-- | drivers/clocksource/sh_cmt.c | 12 | ||||
-rw-r--r-- | drivers/clocksource/sh_tmu.c | 12 | ||||
-rw-r--r-- | drivers/dma/shdma.c | 7 |
3 files changed, 10 insertions, 21 deletions
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c index 036e5865eb40..dc7c033ef587 100644 --- a/drivers/clocksource/sh_cmt.c +++ b/drivers/clocksource/sh_cmt.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/ioport.h> | 24 | #include <linux/ioport.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
27 | #include <linux/pm_runtime.h> | ||
28 | #include <linux/irq.h> | 27 | #include <linux/irq.h> |
29 | #include <linux/err.h> | 28 | #include <linux/err.h> |
30 | #include <linux/clocksource.h> | 29 | #include <linux/clocksource.h> |
@@ -153,12 +152,10 @@ static int sh_cmt_enable(struct sh_cmt_priv *p, unsigned long *rate) | |||
153 | { | 152 | { |
154 | int ret; | 153 | int ret; |
155 | 154 | ||
156 | /* wake up device and enable clock */ | 155 | /* enable clock */ |
157 | pm_runtime_get_sync(&p->pdev->dev); | ||
158 | ret = clk_enable(p->clk); | 156 | ret = clk_enable(p->clk); |
159 | if (ret) { | 157 | if (ret) { |
160 | dev_err(&p->pdev->dev, "cannot enable clock\n"); | 158 | dev_err(&p->pdev->dev, "cannot enable clock\n"); |
161 | pm_runtime_put_sync(&p->pdev->dev); | ||
162 | return ret; | 159 | return ret; |
163 | } | 160 | } |
164 | 161 | ||
@@ -190,9 +187,8 @@ static void sh_cmt_disable(struct sh_cmt_priv *p) | |||
190 | /* disable interrupts in CMT block */ | 187 | /* disable interrupts in CMT block */ |
191 | sh_cmt_write(p, CMCSR, 0); | 188 | sh_cmt_write(p, CMCSR, 0); |
192 | 189 | ||
193 | /* stop clock and mark device as idle */ | 190 | /* stop clock */ |
194 | clk_disable(p->clk); | 191 | clk_disable(p->clk); |
195 | pm_runtime_put_sync(&p->pdev->dev); | ||
196 | } | 192 | } |
197 | 193 | ||
198 | /* private flags */ | 194 | /* private flags */ |
@@ -664,7 +660,6 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev) | |||
664 | 660 | ||
665 | if (p) { | 661 | if (p) { |
666 | dev_info(&pdev->dev, "kept as earlytimer\n"); | 662 | dev_info(&pdev->dev, "kept as earlytimer\n"); |
667 | pm_runtime_enable(&pdev->dev); | ||
668 | return 0; | 663 | return 0; |
669 | } | 664 | } |
670 | 665 | ||
@@ -679,9 +674,6 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev) | |||
679 | kfree(p); | 674 | kfree(p); |
680 | platform_set_drvdata(pdev, NULL); | 675 | platform_set_drvdata(pdev, NULL); |
681 | } | 676 | } |
682 | |||
683 | if (!is_early_platform_device(pdev)) | ||
684 | pm_runtime_enable(&pdev->dev); | ||
685 | return ret; | 677 | return ret; |
686 | } | 678 | } |
687 | 679 | ||
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index 17296288a205..808135768617 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | #include <linux/clk.h> | 27 | #include <linux/clk.h> |
28 | #include <linux/pm_runtime.h> | ||
29 | #include <linux/irq.h> | 28 | #include <linux/irq.h> |
30 | #include <linux/err.h> | 29 | #include <linux/err.h> |
31 | #include <linux/clocksource.h> | 30 | #include <linux/clocksource.h> |
@@ -110,12 +109,10 @@ static int sh_tmu_enable(struct sh_tmu_priv *p) | |||
110 | { | 109 | { |
111 | int ret; | 110 | int ret; |
112 | 111 | ||
113 | /* wake up device and enable clock */ | 112 | /* enable clock */ |
114 | pm_runtime_get_sync(&p->pdev->dev); | ||
115 | ret = clk_enable(p->clk); | 113 | ret = clk_enable(p->clk); |
116 | if (ret) { | 114 | if (ret) { |
117 | dev_err(&p->pdev->dev, "cannot enable clock\n"); | 115 | dev_err(&p->pdev->dev, "cannot enable clock\n"); |
118 | pm_runtime_put_sync(&p->pdev->dev); | ||
119 | return ret; | 116 | return ret; |
120 | } | 117 | } |
121 | 118 | ||
@@ -144,9 +141,8 @@ static void sh_tmu_disable(struct sh_tmu_priv *p) | |||
144 | /* disable interrupts in TMU block */ | 141 | /* disable interrupts in TMU block */ |
145 | sh_tmu_write(p, TCR, 0x0000); | 142 | sh_tmu_write(p, TCR, 0x0000); |
146 | 143 | ||
147 | /* stop clock and mark device as idle */ | 144 | /* stop clock */ |
148 | clk_disable(p->clk); | 145 | clk_disable(p->clk); |
149 | pm_runtime_put_sync(&p->pdev->dev); | ||
150 | } | 146 | } |
151 | 147 | ||
152 | static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta, | 148 | static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta, |
@@ -415,7 +411,6 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev) | |||
415 | 411 | ||
416 | if (p) { | 412 | if (p) { |
417 | dev_info(&pdev->dev, "kept as earlytimer\n"); | 413 | dev_info(&pdev->dev, "kept as earlytimer\n"); |
418 | pm_runtime_enable(&pdev->dev); | ||
419 | return 0; | 414 | return 0; |
420 | } | 415 | } |
421 | 416 | ||
@@ -430,9 +425,6 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev) | |||
430 | kfree(p); | 425 | kfree(p); |
431 | platform_set_drvdata(pdev, NULL); | 426 | platform_set_drvdata(pdev, NULL); |
432 | } | 427 | } |
433 | |||
434 | if (!is_early_platform_device(pdev)) | ||
435 | pm_runtime_enable(&pdev->dev); | ||
436 | return ret; | 428 | return ret; |
437 | } | 429 | } |
438 | 430 | ||
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index 636e40925b16..727e76ff13e1 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c | |||
@@ -1144,6 +1144,8 @@ static int __init sh_dmae_probe(struct platform_device *pdev) | |||
1144 | /* platform data */ | 1144 | /* platform data */ |
1145 | shdev->pdata = pdata; | 1145 | shdev->pdata = pdata; |
1146 | 1146 | ||
1147 | platform_set_drvdata(pdev, shdev); | ||
1148 | |||
1147 | pm_runtime_enable(&pdev->dev); | 1149 | pm_runtime_enable(&pdev->dev); |
1148 | pm_runtime_get_sync(&pdev->dev); | 1150 | pm_runtime_get_sync(&pdev->dev); |
1149 | 1151 | ||
@@ -1256,7 +1258,6 @@ static int __init sh_dmae_probe(struct platform_device *pdev) | |||
1256 | 1258 | ||
1257 | pm_runtime_put(&pdev->dev); | 1259 | pm_runtime_put(&pdev->dev); |
1258 | 1260 | ||
1259 | platform_set_drvdata(pdev, shdev); | ||
1260 | dma_async_device_register(&shdev->common); | 1261 | dma_async_device_register(&shdev->common); |
1261 | 1262 | ||
1262 | return err; | 1263 | return err; |
@@ -1278,6 +1279,8 @@ rst_err: | |||
1278 | 1279 | ||
1279 | if (dmars) | 1280 | if (dmars) |
1280 | iounmap(shdev->dmars); | 1281 | iounmap(shdev->dmars); |
1282 | |||
1283 | platform_set_drvdata(pdev, NULL); | ||
1281 | emapdmars: | 1284 | emapdmars: |
1282 | iounmap(shdev->chan_reg); | 1285 | iounmap(shdev->chan_reg); |
1283 | synchronize_rcu(); | 1286 | synchronize_rcu(); |
@@ -1316,6 +1319,8 @@ static int __exit sh_dmae_remove(struct platform_device *pdev) | |||
1316 | iounmap(shdev->dmars); | 1319 | iounmap(shdev->dmars); |
1317 | iounmap(shdev->chan_reg); | 1320 | iounmap(shdev->chan_reg); |
1318 | 1321 | ||
1322 | platform_set_drvdata(pdev, NULL); | ||
1323 | |||
1319 | synchronize_rcu(); | 1324 | synchronize_rcu(); |
1320 | kfree(shdev); | 1325 | kfree(shdev); |
1321 | 1326 | ||