lkml.org 
[lkml]   [2018]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 09/11] platform: provide early_platform_driver()
Date
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Implement a macro similar to module_platform_driver() which allows to
register early platform drivers with the default early class.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
include/linux/platform_device.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 514ada776004..b565a1237fa6 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -297,6 +297,8 @@ struct early_platform_driver {
#define EARLY_PLATFORM_ID_UNSET -2
#define EARLY_PLATFORM_ID_ERROR -3

+#define EARLY_PLATFORM_DEFAULT_CLASS "earlydev"
+
#ifdef CONFIG_EARLY_PLATFORM_DEVICES

extern int early_platform_driver_register(struct early_platform_driver *epdrv,
@@ -352,6 +354,9 @@ static inline char *early_platform_driver_setup_func(void) \
}
#endif /* MODULE */

+#define early_platform_driver(__platdrv) \
+ early_platform_init(EARLY_PLATFORM_DEFAULT_CLASS, &(__platdrv))
+
#else /* CONFIG_EARLY_PLATFORM_DEVICES */
static inline int
early_platform_driver_register(struct early_platform_driver *epdrv, char *buf)
@@ -380,6 +385,7 @@ static inline int early_platform_driver_register_probe_all(char *class_str,
static inline void early_platform_cleanup(void) {}
#define early_platform_init(class_string, platdrv)
#define early_platform_init_buffer(class_string, platdrv, buf, bufsiz)
+#define early_platform_driver(__platdrv)
#endif /* CONFIG_EARLY_PLATFORM_DEVICES */

#ifdef CONFIG_SUSPEND
--
2.17.0
\
 
 \ /
  Last update: 2018-04-24 19:33    [W:0.069 / U:1.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site