aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/gumstix.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2015-09-19 10:49:44 +0200
committerAndreas Färber <afaerber@suse.de>2015-09-19 16:40:27 +0200
commit8a661aea0e7f6e776c6ebc9abe339a85b34fea1d (patch)
treebdb4040a63f38d86d8c84157b60d71a84927ebb7 /hw/arm/gumstix.c
parente264d29de28c5b0be3d063307ce9fb613b427cc3 (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/gumstix.c')
-rw-r--r--hw/arm/gumstix.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c
index 6dc98c86b4..32ad041b20 100644
--- a/hw/arm/gumstix.c
+++ b/hw/arm/gumstix.c
@@ -121,18 +121,38 @@ static void verdex_init(MachineState *machine)
qdev_get_gpio_in(cpu->gpio, 99));
}
-static void connex_machine_init(MachineClass *mc)
+static void connex_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "Gumstix Connex (PXA255)";
mc->init = connex_init;
}
-DEFINE_MACHINE("connex", connex_machine_init)
+static const TypeInfo connex_type = {
+ .name = MACHINE_TYPE_NAME("connex"),
+ .parent = TYPE_MACHINE,
+ .class_init = connex_class_init,
+};
-static void verdex_machine_init(MachineClass *mc)
+static void verdex_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "Gumstix Verdex (PXA270)";
mc->init = verdex_init;
}
-DEFINE_MACHINE("verdex", verdex_machine_init)
+static const TypeInfo verdex_type = {
+ .name = MACHINE_TYPE_NAME("verdex"),
+ .parent = TYPE_MACHINE,
+ .class_init = verdex_class_init,
+};
+
+static void gumstix_machine_init(void)
+{
+ type_register_static(&connex_type);
+ type_register_static(&verdex_type);
+}
+
+machine_init(gumstix_machine_init)