aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/amba/bus.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-12-17 18:34:31 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2011-12-21 16:03:26 -0500
commit8114ab763b2d297c8af49bf380a093d76e929692 (patch)
treef9d27de1d41f76dba926440b232922337acee229 /drivers/amba/bus.c
parent9b39e73d0c2b265a7f8748b0e9a9f09be84079a8 (diff)
PM / Sleep: Remove forward-only callbacks from AMBA bus type
The forward-only PM callbacks provided by the AMBA bus type are not necessary any more, because the PM core executes driver callbacks when the corresponding subsystem callbacks are not present, so drop them. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/amba/bus.c')
-rw-r--r--drivers/amba/bus.c136
1 files changed, 1 insertions, 135 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index bd230e801131..0304b3fdff5a 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -109,31 +109,7 @@ static int amba_legacy_resume(struct device *dev)
109 return ret; 109 return ret;
110} 110}
111 111
112static int amba_pm_prepare(struct device *dev) 112#endif /* CONFIG_PM_SLEEP */
113{
114 struct device_driver *drv = dev->driver;
115 int ret = 0;
116
117 if (drv && drv->pm && drv->pm->prepare)
118 ret = drv->pm->prepare(dev);
119
120 return ret;
121}
122
123static void amba_pm_complete(struct device *dev)
124{
125 struct device_driver *drv = dev->driver;
126
127 if (drv && drv->pm && drv->pm->complete)
128 drv->pm->complete(dev);
129}
130
131#else /* !CONFIG_PM_SLEEP */
132
133#define amba_pm_prepare NULL
134#define amba_pm_complete NULL
135
136#endif /* !CONFIG_PM_SLEEP */
137 113
138#ifdef CONFIG_SUSPEND 114#ifdef CONFIG_SUSPEND
139 115
@@ -155,22 +131,6 @@ static int amba_pm_suspend(struct device *dev)
155 return ret; 131 return ret;
156} 132}
157 133
158static int amba_pm_suspend_noirq(struct device *dev)
159{
160 struct device_driver *drv = dev->driver;
161 int ret = 0;
162
163 if (!drv)
164 return 0;
165
166 if (drv->pm) {
167 if (drv->pm->suspend_noirq)
168 ret = drv->pm->suspend_noirq(dev);
169 }
170
171 return ret;
172}
173
174static int amba_pm_resume(struct device *dev) 134static int amba_pm_resume(struct device *dev)
175{ 135{
176 struct device_driver *drv = dev->driver; 136 struct device_driver *drv = dev->driver;
@@ -189,28 +149,10 @@ static int amba_pm_resume(struct device *dev)
189 return ret; 149 return ret;
190} 150}
191 151
192static int amba_pm_resume_noirq(struct device *dev)
193{
194 struct device_driver *drv = dev->driver;
195 int ret = 0;
196
197 if (!drv)
198 return 0;
199
200 if (drv->pm) {
201 if (drv->pm->resume_noirq)
202 ret = drv->pm->resume_noirq(dev);
203 }
204
205 return ret;
206}
207
208#else /* !CONFIG_SUSPEND */ 152#else /* !CONFIG_SUSPEND */
209 153
210#define amba_pm_suspend NULL 154#define amba_pm_suspend NULL
211#define amba_pm_resume NULL 155#define amba_pm_resume NULL
212#define amba_pm_suspend_noirq NULL
213#define amba_pm_resume_noirq NULL
214 156
215#endif /* !CONFIG_SUSPEND */ 157#endif /* !CONFIG_SUSPEND */
216 158
@@ -234,22 +176,6 @@ static int amba_pm_freeze(struct device *dev)
234 return ret; 176 return ret;
235} 177}
236 178
237static int amba_pm_freeze_noirq(struct device *dev)
238{
239 struct device_driver *drv = dev->driver;
240 int ret = 0;
241
242 if (!drv)
243 return 0;
244
245 if (drv->pm) {
246 if (drv->pm->freeze_noirq)
247 ret = drv->pm->freeze_noirq(dev);
248 }
249
250 return ret;
251}
252
253static int amba_pm_thaw(struct device *dev) 179static int amba_pm_thaw(struct device *dev)
254{ 180{
255 struct device_driver *drv = dev->driver; 181 struct device_driver *drv = dev->driver;
@@ -268,22 +194,6 @@ static int amba_pm_thaw(struct device *dev)
268 return ret; 194 return ret;
269} 195}
270 196
271static int amba_pm_thaw_noirq(struct device *dev)
272{
273 struct device_driver *drv = dev->driver;
274 int ret = 0;
275
276 if (!drv)
277 return 0;
278
279 if (drv->pm) {
280 if (drv->pm->thaw_noirq)
281 ret = drv->pm->thaw_noirq(dev);
282 }
283
284 return ret;
285}
286
287static int amba_pm_poweroff(struct device *dev) 197static int amba_pm_poweroff(struct device *dev)
288{ 198{
289 struct device_driver *drv = dev->driver; 199 struct device_driver *drv = dev->driver;
@@ -302,22 +212,6 @@ static int amba_pm_poweroff(struct device *dev)
302 return ret; 212 return ret;
303} 213}
304 214
305static int amba_pm_poweroff_noirq(struct device *dev)
306{
307 struct device_driver *drv = dev->driver;
308 int ret = 0;
309
310 if (!drv)
311 return 0;
312
313 if (drv->pm) {
314 if (drv->pm->poweroff_noirq)
315 ret = drv->pm->poweroff_noirq(dev);
316 }
317
318 return ret;
319}
320
321static int amba_pm_restore(struct device *dev) 215static int amba_pm_restore(struct device *dev)
322{ 216{
323 struct device_driver *drv = dev->driver; 217 struct device_driver *drv = dev->driver;
@@ -336,32 +230,12 @@ static int amba_pm_restore(struct device *dev)
336 return ret; 230 return ret;
337} 231}
338 232
339static int amba_pm_restore_noirq(struct device *dev)
340{
341 struct device_driver *drv = dev->driver;
342 int ret = 0;
343
344 if (!drv)
345 return 0;
346
347 if (drv->pm) {
348 if (drv->pm->restore_noirq)
349 ret = drv->pm->restore_noirq(dev);
350 }
351
352 return ret;
353}
354
355#else /* !CONFIG_HIBERNATE_CALLBACKS */ 233#else /* !CONFIG_HIBERNATE_CALLBACKS */
356 234
357#define amba_pm_freeze NULL 235#define amba_pm_freeze NULL
358#define amba_pm_thaw NULL 236#define amba_pm_thaw NULL
359#define amba_pm_poweroff NULL 237#define amba_pm_poweroff NULL
360#define amba_pm_restore NULL 238#define amba_pm_restore NULL
361#define amba_pm_freeze_noirq NULL
362#define amba_pm_thaw_noirq NULL
363#define amba_pm_poweroff_noirq NULL
364#define amba_pm_restore_noirq NULL
365 239
366#endif /* !CONFIG_HIBERNATE_CALLBACKS */ 240#endif /* !CONFIG_HIBERNATE_CALLBACKS */
367 241
@@ -402,20 +276,12 @@ static int amba_pm_runtime_resume(struct device *dev)
402#ifdef CONFIG_PM 276#ifdef CONFIG_PM
403 277
404static const struct dev_pm_ops amba_pm = { 278static const struct dev_pm_ops amba_pm = {
405 .prepare = amba_pm_prepare,
406 .complete = amba_pm_complete,
407 .suspend = amba_pm_suspend, 279 .suspend = amba_pm_suspend,
408 .resume = amba_pm_resume, 280 .resume = amba_pm_resume,
409 .freeze = amba_pm_freeze, 281 .freeze = amba_pm_freeze,
410 .thaw = amba_pm_thaw, 282 .thaw = amba_pm_thaw,
411 .poweroff = amba_pm_poweroff, 283 .poweroff = amba_pm_poweroff,
412 .restore = amba_pm_restore, 284 .restore = amba_pm_restore,
413 .suspend_noirq = amba_pm_suspend_noirq,
414 .resume_noirq = amba_pm_resume_noirq,
415 .freeze_noirq = amba_pm_freeze_noirq,
416 .thaw_noirq = amba_pm_thaw_noirq,
417 .poweroff_noirq = amba_pm_poweroff_noirq,
418 .restore_noirq = amba_pm_restore_noirq,
419 SET_RUNTIME_PM_OPS( 285 SET_RUNTIME_PM_OPS(
420 amba_pm_runtime_suspend, 286 amba_pm_runtime_suspend,
421 amba_pm_runtime_resume, 287 amba_pm_runtime_resume,