diff options
Diffstat (limited to 'include/linux/platform_device.h')
| -rw-r--r-- | include/linux/platform_device.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 3c6675c2444b..71ff887ca44e 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -83,6 +83,8 @@ struct early_platform_driver { | |||
| 83 | struct platform_driver *pdrv; | 83 | struct platform_driver *pdrv; |
| 84 | struct list_head list; | 84 | struct list_head list; |
| 85 | int requested_id; | 85 | int requested_id; |
| 86 | char *buffer; | ||
| 87 | int bufsize; | ||
| 86 | }; | 88 | }; |
| 87 | 89 | ||
| 88 | #define EARLY_PLATFORM_ID_UNSET -2 | 90 | #define EARLY_PLATFORM_ID_UNSET -2 |
| @@ -102,21 +104,29 @@ extern int early_platform_driver_probe(char *class_str, | |||
| 102 | int nr_probe, int user_only); | 104 | int nr_probe, int user_only); |
| 103 | extern void early_platform_cleanup(void); | 105 | extern void early_platform_cleanup(void); |
| 104 | 106 | ||
| 107 | #define early_platform_init(class_string, platdrv) \ | ||
| 108 | early_platform_init_buffer(class_string, platdrv, NULL, 0) | ||
| 105 | 109 | ||
| 106 | #ifndef MODULE | 110 | #ifndef MODULE |
| 107 | #define early_platform_init(class_string, platform_driver) \ | 111 | #define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \ |
| 108 | static __initdata struct early_platform_driver early_driver = { \ | 112 | static __initdata struct early_platform_driver early_driver = { \ |
| 109 | .class_str = class_string, \ | 113 | .class_str = class_string, \ |
| 110 | .pdrv = platform_driver, \ | 114 | .buffer = buf, \ |
| 115 | .bufsize = bufsiz, \ | ||
| 116 | .pdrv = platdrv, \ | ||
| 111 | .requested_id = EARLY_PLATFORM_ID_UNSET, \ | 117 | .requested_id = EARLY_PLATFORM_ID_UNSET, \ |
| 112 | }; \ | 118 | }; \ |
| 113 | static int __init early_platform_driver_setup_func(char *buf) \ | 119 | static int __init early_platform_driver_setup_func(char *buffer) \ |
| 114 | { \ | 120 | { \ |
| 115 | return early_platform_driver_register(&early_driver, buf); \ | 121 | return early_platform_driver_register(&early_driver, buffer); \ |
| 116 | } \ | 122 | } \ |
| 117 | early_param(class_string, early_platform_driver_setup_func) | 123 | early_param(class_string, early_platform_driver_setup_func) |
| 118 | #else /* MODULE */ | 124 | #else /* MODULE */ |
| 119 | #define early_platform_init(class_string, platform_driver) | 125 | #define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \ |
| 126 | static inline char *early_platform_driver_setup_func(void) \ | ||
| 127 | { \ | ||
| 128 | return bufsiz ? buf : NULL; \ | ||
| 129 | } | ||
| 120 | #endif /* MODULE */ | 130 | #endif /* MODULE */ |
| 121 | 131 | ||
| 122 | #endif /* _PLATFORM_DEVICE_H_ */ | 132 | #endif /* _PLATFORM_DEVICE_H_ */ |
