Use named field's initializer when constructing <foo>_platform structure.
In current code, the delay argument in FDT_PLATFORM_DEF(2) improperly initialize refs field from kobj_class structure instead of delay_count field. This causes not working DELAY() function (due to never initialized delay_count) in earlier boot stages, until the first timer was attached. MFC after: 2 weeks
This commit is contained in:
parent
2dd13cf6a4
commit
966e7b050d
@ -90,22 +90,22 @@ typedef struct fdt_platform_class fdt_platform_def_t;
|
||||
|
||||
extern platform_method_t fdt_platform_methods[];
|
||||
|
||||
#define FDT_PLATFORM_DEF2(NAME, VAR_NAME, NAME_STR, size, compatible, \
|
||||
delay) \
|
||||
CTASSERT(delay > 0); \
|
||||
#define FDT_PLATFORM_DEF2(NAME, VAR_NAME, NAME_STR, _size, _compatible, \
|
||||
_delay) \
|
||||
CTASSERT(_delay > 0); \
|
||||
static fdt_platform_def_t VAR_NAME ## _fdt_platform = { \
|
||||
.name = NAME_STR, \
|
||||
.methods = fdt_platform_methods, \
|
||||
.fdt_compatible = compatible, \
|
||||
.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, \
|
||||
delay, \
|
||||
.name = NAME_STR, \
|
||||
.methods = NAME ## _methods, \
|
||||
.size = _size, \
|
||||
.baseclasses = VAR_NAME ## _baseclasses, \
|
||||
.delay_count = _delay, \
|
||||
}; \
|
||||
DATA_SET(platform_set, VAR_NAME ## _platform)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user