init: add SYS_INIT() This is to be used by subsystem that don't really want to create a device but rather only want to be initialized automatically during the kernel init sequence. It is just a wrapper around DEVICE_INIT(), and thus still uses a device object, but it hides that fact and can be replaced in the future without changing its model. It can be used when a device created does not have objects associated with it, but only an init function, and also when the device name (DEVICE_INIT(<dev_name>, ...) does not matter. Change-Id: I5488f430a6fb757cdcb499ef352775dc67aa0565 Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
diff --git a/include/init.h b/include/init.h index c65c803..7adec2f 100644 --- a/include/init.h +++ b/include/init.h
@@ -38,6 +38,9 @@ #define _SYS_INIT_LEVEL_MICROKERNEL 3 #define _SYS_INIT_LEVEL_APPLICATION 4 +#define SYS_INIT(init_fn, level, prio) \ + DEVICE_INIT(sys_init_##init_fn, "", init_fn, NULL, NULL, level, prio) + #ifdef __cplusplus } #endif