init: use SYS_INIT() where it makes sense

Mostly SoC initialization and some kernel subsystems, but also some
device drivers like the interrupt controllers.

Change-Id: I8dc1844c33acd877c075b6b03558fdca6f87500b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
Benjamin Walsh 2016-01-28 15:16:31 -05:00 committed by Anas Nashif
commit a4ec963138
21 changed files with 26 additions and 69 deletions

View file

@ -48,6 +48,5 @@ static int quark_se_arc_init(struct device *arg)
shared_data->flags |= ARC_READY;
return 0;
}
DEVICE_INIT(quark_se_arc_0, "", quark_se_arc_init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(quark_se_arc_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

View file

@ -71,8 +71,6 @@ static int uart_ns16550_init(struct device *dev)
return DEV_OK;
}
DEVICE_INIT(uart_ns16550_init, "", uart_ns16550_init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(uart_ns16550_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_UART_NS16550 */

View file

@ -194,6 +194,4 @@ static int atmel_sam3_init(struct device *arg)
return 0;
}
DEVICE_INIT(atmel_sam3_0, "", atmel_sam3_init,
NULL, NULL,
PRIMARY, 0);
DEVICE_INIT(atmel_sam3_init, PRIMARY, 0);

View file

@ -320,6 +320,4 @@ static int fsl_frdm_k64f_init(struct device *arg)
return 0;
}
DEVICE_INIT(fsl_frdm_0, "", fsl_frdm_k64f_init,
NULL, NULL,
PRIMARY, 0);
SYS_INIT(fsl_frdm_k64f_init, PRIMARY, 0);

View file

@ -71,9 +71,7 @@ static int uart_k20_console_init(struct device *dev)
return DEV_OK;
}
DEVICE_INIT(_uart_k20_console, "", uart_k20_console_init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(uart_k20_console_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif
#endif /* CONFIG_UART_CONSOLE */

View file

@ -56,6 +56,4 @@ static int ti_lm3s6965_init(struct device *arg)
return 0;
}
DEVICE_INIT(ti_lm3_0, "", ti_lm3s6965_init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(ti_lm3s6965_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

View file

@ -51,8 +51,6 @@ static int uart_stellaris_init(struct device *dev)
return DEV_OK;
}
DEVICE_INIT(_uart_stellaris_en, "", uart_stellaris_init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
SYS_INIT(uart_stellaris_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
#endif /* CONFIG_UART_STELLARIS */

View file

@ -107,8 +107,6 @@ static int init_cache(struct device *unused)
return 0;
}
DEVICE_INIT(cache, "", init_cache,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(init_cache, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_CLFLUSH_DETECT || CONFIG_CACHE_LINE_SIZE_DETECT */

View file

@ -62,12 +62,8 @@ static int quark_d2000_init(struct device *arg)
return 0;
}
DEVICE_INIT(quark_d2000_0, "", quark_d2000_init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(quark_d2000_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#ifdef CONFIG_MVIC
DEVICE_INIT(mvic_0, "", _mvic_init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(_mvic_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_IOAPIC */

View file

@ -86,9 +86,7 @@ static int arc_init(struct device *arg)
return DEV_OK;
}
DEVICE_INIT(quark_se_ss_0, "", arc_init,
NULL, NULL,
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(arc_init, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /*CONFIG_ARC_INIT*/
@ -110,9 +108,7 @@ static int platform_uart_init(struct device *arg)
return DEV_OK;
}
DEVICE_INIT(platform_uart_init, "", platform_uart_init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(platform_uart_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
#endif /* CONFIG_UART_NS16550 */

View file

@ -67,7 +67,6 @@ static int pci_legacy_bridge_irq_config(struct device *unused)
return 0;
}
DEVICE_INIT(pci_legacy_bridge_0, "", pci_legacy_bridge_irq_config,
NULL, NULL,
SYS_INIT(pci_legacy_bridge_irq_config,
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
#endif /* CONFIG_PCI_LEGACY_BRIDGE */

View file

@ -259,6 +259,4 @@ static int _bt_uart_init(struct device *unused)
return DEV_OK;
}
DEVICE_INIT(bt_uart, "", _bt_uart_init,
NULL, NULL,
NANOKERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
SYS_INIT(_bt_uart_init, NANOKERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);

View file

@ -790,6 +790,4 @@ static int _bt_uart_init(struct device *unused)
return DEV_OK;
}
DEVICE_INIT(bt_uart, "", _bt_uart_init,
NULL, NULL,
NANOKERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
SYS_INIT(_bt_uart_init, NANOKERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);

View file

@ -45,7 +45,4 @@ static int ram_console_init(struct device *d)
return DEV_OK;
}
DEVICE_INIT(ram_console, "", ram_console_init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(ram_console_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

View file

@ -431,8 +431,7 @@ static int uart_console_init(struct device *arg)
}
/* UART consloe initializes after the UART device itself */
DEVICE_INIT(uart_console, "", uart_console_init,
NULL, NULL,
SYS_INIT(uart_console_init,
#if defined(CONFIG_EARLY_CONSOLE)
PRIMARY,
#else

View file

@ -62,6 +62,4 @@ int _i8259_init(struct device *unused)
return 0;
}
DEVICE_INIT(pic_0, "", _i8259_init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(_i8259_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

View file

@ -314,6 +314,4 @@ static void _IoApicRedUpdateLo(unsigned int irq,
ioApicRedSetLo(irq, (ioApicRedGetLo(irq) & ~mask) | (value & mask));
}
DEVICE_INIT(ioapic_0, "", _ioapic_init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(_ioapic_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

View file

@ -444,9 +444,7 @@ int _loapic_isr_vector_get(void)
return 0;
}
DEVICE_INIT(loapic_0, "", _loapic_init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(_loapic_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#if CONFIG_LOAPIC_SPURIOUS_VECTOR
extern void _loapic_spurious_handler(void);

View file

@ -32,6 +32,4 @@
#include <init.h>
#include <drivers/system_timer.h>
DEVICE_INIT(sys_clock, "sys_clock", _sys_clock_driver_init,
NULL, NULL,
NANOKERNEL, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);
SYS_INIT(_sys_clock_driver_init, NANOKERNEL, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);

View file

@ -53,8 +53,7 @@ static int _sys_k_event_logger_init(struct device *arg)
return 0;
}
DEVICE_INIT(kernel_event_logger_0, "", _sys_k_event_logger_init,
NULL, NULL,
SYS_INIT(_sys_k_event_logger_init,
NANOKERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

View file

@ -290,6 +290,4 @@ static int init(struct device *unused)
return 0;
}
DEVICE_INIT(mem_safe, "", init,
NULL, NULL,
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);