Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.
Inline the standalone 'aspeed_vic_info' TypeInfo variable directly
into the 'aspeed_vic_types[]' array, removing the need for a separate
declaration.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
hw/intc/aspeed_vic.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/hw/intc/aspeed_vic.c b/hw/intc/aspeed_vic.c
index 13d8423d83..bd0c87802e 100644
--- a/hw/intc/aspeed_vic.c
+++ b/hw/intc/aspeed_vic.c
@@ -349,16 +349,13 @@ static void aspeed_vic_class_init(ObjectClass *klass, const void *data)
dc->vmsd = &vmstate_aspeed_vic;
}
-static const TypeInfo aspeed_vic_info = {
- .name = TYPE_ASPEED_VIC,
- .parent = TYPE_SYS_BUS_DEVICE,
- .instance_size = sizeof(AspeedVICState),
- .class_init = aspeed_vic_class_init,
+static const TypeInfo aspeed_vic_types[] = {
+ {
+ .name = TYPE_ASPEED_VIC,
+ .parent = TYPE_SYS_BUS_DEVICE,
+ .instance_size = sizeof(AspeedVICState),
+ .class_init = aspeed_vic_class_init,
+ }
};
-static void aspeed_vic_register_types(void)
-{
- type_register_static(&aspeed_vic_info);
-}
-
-type_init(aspeed_vic_register_types);
+DEFINE_TYPES(aspeed_vic_types)
--
2.43.0