mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
qom: Unify type registration
Replace device_init() with generalized type_init(). While at it, unify naming convention: type_init([$prefix_]register_types) Also, type_init() is a function, so add preceding blank line where necessary and don't put a semicolon after the closing brace. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Cc: malc <av1474@comtv.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
59f971d451
commit
83f7d43a9e
233 changed files with 551 additions and 554 deletions
37
hw/sun4m.c
37
hw/sun4m.c
|
@ -623,13 +623,6 @@ static TypeInfo idreg_info = {
|
|||
.class_init = idreg_class_init,
|
||||
};
|
||||
|
||||
static void idreg_register_devices(void)
|
||||
{
|
||||
type_register_static(&idreg_info);
|
||||
}
|
||||
|
||||
device_init(idreg_register_devices);
|
||||
|
||||
typedef struct AFXState {
|
||||
SysBusDevice busdev;
|
||||
MemoryRegion mem;
|
||||
|
@ -672,13 +665,6 @@ static TypeInfo afx_info = {
|
|||
.class_init = afx_class_init,
|
||||
};
|
||||
|
||||
static void afx_register_devices(void)
|
||||
{
|
||||
type_register_static(&afx_info);
|
||||
}
|
||||
|
||||
device_init(afx_register_devices);
|
||||
|
||||
typedef struct PROMState {
|
||||
SysBusDevice busdev;
|
||||
MemoryRegion prom;
|
||||
|
@ -756,13 +742,6 @@ static TypeInfo prom_info = {
|
|||
.class_init = prom_class_init,
|
||||
};
|
||||
|
||||
static void prom_register_devices(void)
|
||||
{
|
||||
type_register_static(&prom_info);
|
||||
}
|
||||
|
||||
device_init(prom_register_devices);
|
||||
|
||||
typedef struct RamDevice
|
||||
{
|
||||
SysBusDevice busdev;
|
||||
|
@ -827,13 +806,6 @@ static TypeInfo ram_info = {
|
|||
.class_init = ram_class_init,
|
||||
};
|
||||
|
||||
static void ram_register_devices(void)
|
||||
{
|
||||
type_register_static(&ram_info);
|
||||
}
|
||||
|
||||
device_init(ram_register_devices);
|
||||
|
||||
static void cpu_devinit(const char *cpu_model, unsigned int id,
|
||||
uint64_t prom_addr, qemu_irq **cpu_irqs)
|
||||
{
|
||||
|
@ -1865,6 +1837,14 @@ static QEMUMachine ss2_machine = {
|
|||
.use_scsi = 1,
|
||||
};
|
||||
|
||||
static void sun4m_register_types(void)
|
||||
{
|
||||
type_register_static(&idreg_info);
|
||||
type_register_static(&afx_info);
|
||||
type_register_static(&prom_info);
|
||||
type_register_static(&ram_info);
|
||||
}
|
||||
|
||||
static void ss2_machine_init(void)
|
||||
{
|
||||
qemu_register_machine(&ss5_machine);
|
||||
|
@ -1881,4 +1861,5 @@ static void ss2_machine_init(void)
|
|||
qemu_register_machine(&ss2_machine);
|
||||
}
|
||||
|
||||
type_init(sun4m_register_types)
|
||||
machine_init(ss2_machine_init);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue