diff options
author | Andreas Färber <afaerber@suse.de> | 2012-02-09 15:20:55 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-02-15 09:39:21 -0600 |
commit | 83f7d43a9ef70b1b91e465173e18c845420e931e (patch) | |
tree | c34cbc9d6f7986f2d643a9e7077a519386dbb55a /hw/sun4m.c | |
parent | 59f971d451fbabee3194bb565f40846398ee6e6f (diff) |
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>
Diffstat (limited to 'hw/sun4m.c')
-rw-r--r-- | hw/sun4m.c | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/hw/sun4m.c b/hw/sun4m.c index b79d14c35a..99fb219b3a 100644 --- a/hw/sun4m.c +++ b/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); |