From 5adffc78c9da78bab7d3bb2a187b5f17178d676e Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 17 May 2014 18:02:46 +0000 Subject: [PATCH] Add FDT_PLATFORM_DEF2 for when there are multiple platforms needing to use the same platform methods. --- sys/arm/include/platformvar.h | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/sys/arm/include/platformvar.h b/sys/arm/include/platformvar.h index a2e1989da644..cfee255c6271 100644 --- a/sys/arm/include/platformvar.h +++ b/sys/arm/include/platformvar.h @@ -83,21 +83,24 @@ typedef struct fdt_platform_class fdt_platform_def_t; extern platform_method_t fdt_platform_methods[]; -#define FDT_PLATFORM_DEF(NAME, NAME_STR, size, compatible) \ -static fdt_platform_def_t NAME ## _fdt_platform = { \ - .name = NAME_STR, \ - .methods = fdt_platform_methods, \ - .fdt_compatible = compatible, \ -}; \ -static kobj_class_t NAME ## _baseclasses[] = \ - { (kobj_class_t)&NAME ## _fdt_platform, NULL }; \ -static platform_def_t NAME ## _platform = { \ - NAME_STR, \ - NAME ## _methods, \ - size, \ - NAME ## _baseclasses, \ -}; \ -DATA_SET(platform_set, NAME ## _platform) +#define FDT_PLATFORM_DEF2(NAME, VAR_NAME, NAME_STR, size, compatible) \ +static fdt_platform_def_t VAR_NAME ## _fdt_platform = { \ + .name = NAME_STR, \ + .methods = fdt_platform_methods, \ + .fdt_compatible = compatible, \ +}; \ +static kobj_class_t VAR_NAME ## _baseclasses[] = \ + { (kobj_class_t)&VAR_NAME ## _fdt_platform, NULL }; \ +static platform_def_t VAR_NAME ## _platform = { \ + NAME_STR, \ + NAME ## _methods, \ + size, \ + VAR_NAME ## _baseclasses, \ +}; \ +DATA_SET(platform_set, VAR_NAME ## _platform) + +#define FDT_PLATFORM_DEF(NAME, NAME_STR, size, compatible) \ + FDT_PLATFORM_DEF2(NAME, NAME, NAME_STR, size, compatible) #endif