diff options
Diffstat (limited to 'include/linux/platform_device.h')
-rw-r--r-- | include/linux/platform_device.h | 44 |
1 files changed, 4 insertions, 40 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 2a23f7d1a825..60e9994ef405 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -63,7 +63,7 @@ struct platform_device_info { | |||
63 | u64 dma_mask; | 63 | u64 dma_mask; |
64 | }; | 64 | }; |
65 | extern struct platform_device *platform_device_register_full( | 65 | extern struct platform_device *platform_device_register_full( |
66 | struct platform_device_info *pdevinfo); | 66 | const struct platform_device_info *pdevinfo); |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * platform_device_register_resndata - add a platform-level device with | 69 | * platform_device_register_resndata - add a platform-level device with |
@@ -196,16 +196,8 @@ static inline void platform_set_drvdata(struct platform_device *pdev, void *data | |||
196 | * calling it replaces module_init() and module_exit() | 196 | * calling it replaces module_init() and module_exit() |
197 | */ | 197 | */ |
198 | #define module_platform_driver(__platform_driver) \ | 198 | #define module_platform_driver(__platform_driver) \ |
199 | static int __init __platform_driver##_init(void) \ | 199 | module_driver(__platform_driver, platform_driver_register, \ |
200 | { \ | 200 | platform_driver_unregister) |
201 | return platform_driver_register(&(__platform_driver)); \ | ||
202 | } \ | ||
203 | module_init(__platform_driver##_init); \ | ||
204 | static void __exit __platform_driver##_exit(void) \ | ||
205 | { \ | ||
206 | platform_driver_unregister(&(__platform_driver)); \ | ||
207 | } \ | ||
208 | module_exit(__platform_driver##_exit); | ||
209 | 201 | ||
210 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, | 202 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, |
211 | int (*probe)(struct platform_device *), | 203 | int (*probe)(struct platform_device *), |
@@ -264,62 +256,34 @@ static inline char *early_platform_driver_setup_func(void) \ | |||
264 | } | 256 | } |
265 | #endif /* MODULE */ | 257 | #endif /* MODULE */ |
266 | 258 | ||
267 | #ifdef CONFIG_PM_SLEEP | ||
268 | extern int platform_pm_prepare(struct device *dev); | ||
269 | extern void platform_pm_complete(struct device *dev); | ||
270 | #else | ||
271 | #define platform_pm_prepare NULL | ||
272 | #define platform_pm_complete NULL | ||
273 | #endif | ||
274 | |||
275 | #ifdef CONFIG_SUSPEND | 259 | #ifdef CONFIG_SUSPEND |
276 | extern int platform_pm_suspend(struct device *dev); | 260 | extern int platform_pm_suspend(struct device *dev); |
277 | extern int platform_pm_suspend_noirq(struct device *dev); | ||
278 | extern int platform_pm_resume(struct device *dev); | 261 | extern int platform_pm_resume(struct device *dev); |
279 | extern int platform_pm_resume_noirq(struct device *dev); | ||
280 | #else | 262 | #else |
281 | #define platform_pm_suspend NULL | 263 | #define platform_pm_suspend NULL |
282 | #define platform_pm_resume NULL | 264 | #define platform_pm_resume NULL |
283 | #define platform_pm_suspend_noirq NULL | ||
284 | #define platform_pm_resume_noirq NULL | ||
285 | #endif | 265 | #endif |
286 | 266 | ||
287 | #ifdef CONFIG_HIBERNATE_CALLBACKS | 267 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
288 | extern int platform_pm_freeze(struct device *dev); | 268 | extern int platform_pm_freeze(struct device *dev); |
289 | extern int platform_pm_freeze_noirq(struct device *dev); | ||
290 | extern int platform_pm_thaw(struct device *dev); | 269 | extern int platform_pm_thaw(struct device *dev); |
291 | extern int platform_pm_thaw_noirq(struct device *dev); | ||
292 | extern int platform_pm_poweroff(struct device *dev); | 270 | extern int platform_pm_poweroff(struct device *dev); |
293 | extern int platform_pm_poweroff_noirq(struct device *dev); | ||
294 | extern int platform_pm_restore(struct device *dev); | 271 | extern int platform_pm_restore(struct device *dev); |
295 | extern int platform_pm_restore_noirq(struct device *dev); | ||
296 | #else | 272 | #else |
297 | #define platform_pm_freeze NULL | 273 | #define platform_pm_freeze NULL |
298 | #define platform_pm_thaw NULL | 274 | #define platform_pm_thaw NULL |
299 | #define platform_pm_poweroff NULL | 275 | #define platform_pm_poweroff NULL |
300 | #define platform_pm_restore NULL | 276 | #define platform_pm_restore NULL |
301 | #define platform_pm_freeze_noirq NULL | ||
302 | #define platform_pm_thaw_noirq NULL | ||
303 | #define platform_pm_poweroff_noirq NULL | ||
304 | #define platform_pm_restore_noirq NULL | ||
305 | #endif | 277 | #endif |
306 | 278 | ||
307 | #ifdef CONFIG_PM_SLEEP | 279 | #ifdef CONFIG_PM_SLEEP |
308 | #define USE_PLATFORM_PM_SLEEP_OPS \ | 280 | #define USE_PLATFORM_PM_SLEEP_OPS \ |
309 | .prepare = platform_pm_prepare, \ | ||
310 | .complete = platform_pm_complete, \ | ||
311 | .suspend = platform_pm_suspend, \ | 281 | .suspend = platform_pm_suspend, \ |
312 | .resume = platform_pm_resume, \ | 282 | .resume = platform_pm_resume, \ |
313 | .freeze = platform_pm_freeze, \ | 283 | .freeze = platform_pm_freeze, \ |
314 | .thaw = platform_pm_thaw, \ | 284 | .thaw = platform_pm_thaw, \ |
315 | .poweroff = platform_pm_poweroff, \ | 285 | .poweroff = platform_pm_poweroff, \ |
316 | .restore = platform_pm_restore, \ | 286 | .restore = platform_pm_restore, |
317 | .suspend_noirq = platform_pm_suspend_noirq, \ | ||
318 | .resume_noirq = platform_pm_resume_noirq, \ | ||
319 | .freeze_noirq = platform_pm_freeze_noirq, \ | ||
320 | .thaw_noirq = platform_pm_thaw_noirq, \ | ||
321 | .poweroff_noirq = platform_pm_poweroff_noirq, \ | ||
322 | .restore_noirq = platform_pm_restore_noirq, | ||
323 | #else | 287 | #else |
324 | #define USE_PLATFORM_PM_SLEEP_OPS | 288 | #define USE_PLATFORM_PM_SLEEP_OPS |
325 | #endif | 289 | #endif |