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/sun4u.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/sun4u.c')
-rw-r--r-- | hw/sun4u.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/hw/sun4u.c b/hw/sun4u.c index 79bbd495eb..423108f236 100644 --- a/hw/sun4u.c +++ b/hw/sun4u.c @@ -580,13 +580,6 @@ static TypeInfo ebus_info = { .class_init = ebus_class_init, }; -static void pci_ebus_register(void) -{ - type_register_static(&ebus_info); -} - -device_init(pci_ebus_register); - typedef struct PROMState { SysBusDevice busdev; MemoryRegion prom; @@ -664,13 +657,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 { @@ -728,13 +714,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 CPUState *cpu_devinit(const char *cpu_model, const struct hwdef *hwdef) { CPUState *env; @@ -957,6 +936,13 @@ static QEMUMachine niagara_machine = { .max_cpus = 1, // XXX for now }; +static void sun4u_register_types(void) +{ + type_register_static(&ebus_info); + type_register_static(&prom_info); + type_register_static(&ram_info); +} + static void sun4u_machine_init(void) { qemu_register_machine(&sun4u_machine); @@ -964,4 +950,5 @@ static void sun4u_machine_init(void) qemu_register_machine(&niagara_machine); } +type_init(sun4u_register_types) machine_init(sun4u_machine_init); |