[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 08/24] q800-glue.c: switch TypeInfo registration to use DEFINE
From: |
Mark Cave-Ayland |
Subject: |
[PATCH v4 08/24] q800-glue.c: switch TypeInfo registration to use DEFINE_TYPES() macro |
Date: |
Wed, 21 Jun 2023 09:53:37 +0100 |
The use of the DEFINE_TYPES() macro will soon be recommended over the use of
calling type_init() directly.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/m68k/q800-glue.c | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/hw/m68k/q800-glue.c b/hw/m68k/q800-glue.c
index e81f9438f1..34c4f0e987 100644
--- a/hw/m68k/q800-glue.c
+++ b/hw/m68k/q800-glue.c
@@ -231,22 +231,19 @@ static void glue_class_init(ObjectClass *klass, void
*data)
nc->nmi_monitor_handler = glue_nmi;
}
-static const TypeInfo glue_info = {
- .name = TYPE_GLUE,
- .parent = TYPE_SYS_BUS_DEVICE,
- .instance_size = sizeof(GLUEState),
- .instance_init = glue_init,
- .instance_finalize = glue_finalize,
- .class_init = glue_class_init,
- .interfaces = (InterfaceInfo[]) {
- { TYPE_NMI },
- { }
+static const TypeInfo glue_info_types[] = {
+ {
+ .name = TYPE_GLUE,
+ .parent = TYPE_SYS_BUS_DEVICE,
+ .instance_size = sizeof(GLUEState),
+ .instance_init = glue_init,
+ .instance_finalize = glue_finalize,
+ .class_init = glue_class_init,
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_NMI },
+ { }
+ },
},
};
-static void glue_register_types(void)
-{
- type_register_static(&glue_info);
-}
-
-type_init(glue_register_types)
+DEFINE_TYPES(glue_info_types)
--
2.30.2
- [PATCH v4 03/24] q800: introduce Q800MachineState, (continued)
- [PATCH v4 04/24] q800: rename q800_init() to q800_machine_init(), Mark Cave-Ayland, 2023/06/21
- [PATCH v4 05/24] q800: move CPU object into Q800MachineState, Mark Cave-Ayland, 2023/06/21
- [PATCH v4 06/24] q800: move ROM memory region to Q800MachineState, Mark Cave-Ayland, 2023/06/21
- [PATCH v4 08/24] q800-glue.c: switch TypeInfo registration to use DEFINE_TYPES() macro,
Mark Cave-Ayland <=
- [PATCH v4 07/24] q800: move GLUE device into separate q800-glue.c file, Mark Cave-Ayland, 2023/06/21
[PATCH v4 09/24] q800: move GLUE device to Q800MachineState, Mark Cave-Ayland, 2023/06/21
[PATCH v4 10/24] q800: introduce mac-io container memory region, Mark Cave-Ayland, 2023/06/21