diff options
author | Andreas Färber <afaerber@suse.de> | 2015-09-19 10:49:44 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2015-09-19 16:40:27 +0200 |
commit | 8a661aea0e7f6e776c6ebc9abe339a85b34fea1d (patch) | |
tree | bdb4040a63f38d86d8c84157b60d71a84927ebb7 /hw/arm/nseries.c | |
parent | e264d29de28c5b0be3d063307ce9fb613b427cc3 (diff) |
Revert use of DEFINE_MACHINE() for registrations of multiple machines
The script used for converting from QEMUMachine had used one
DEFINE_MACHINE() per machine registered. In cases where multiple
machines are registered from one source file, avoid the excessive
generation of module init functions by reverting this unrolling.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/arm/nseries.c')
-rw-r--r-- | hw/arm/nseries.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index af28449367..6a6b3e6642 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -1413,20 +1413,40 @@ static void n810_init(MachineState *machine) n8x0_init(machine, &n810_binfo, 810); } -static void n800_machine_init(MachineClass *mc) +static void n800_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Nokia N800 tablet aka. RX-34 (OMAP2420)"; mc->init = n800_init; mc->default_boot_order = ""; } -DEFINE_MACHINE("n800", n800_machine_init) +static const TypeInfo n800_type = { + .name = MACHINE_TYPE_NAME("n800"), + .parent = TYPE_MACHINE, + .class_init = n800_class_init, +}; -static void n810_machine_init(MachineClass *mc) +static void n810_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Nokia N810 tablet aka. RX-44 (OMAP2420)"; mc->init = n810_init; mc->default_boot_order = ""; } -DEFINE_MACHINE("n810", n810_machine_init) +static const TypeInfo n810_type = { + .name = MACHINE_TYPE_NAME("n810"), + .parent = TYPE_MACHINE, + .class_init = n810_class_init, +}; + +static void nseries_machine_init(void) +{ + type_register_static(&n800_type); + type_register_static(&n810_type); +} + +machine_init(nseries_machine_init) |