@samitouri / QOSamiQemu / commits / 32b530c7d2

hw/intc/aspeed_vic: Convert to DEFINE_TYPES() with inlined TypeInfo

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> Reviewed-by: Cédric Le Goater <clg@redhat.com> Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-16-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Jamin Lin committed Jun 1, 2026 at 02:50 UTC 32b530c7d21eef576154044648392d291a339da7
1 file changed +8 -11
hw/intc/aspeed_vic.c
+8 -11
@@ -349,16 +349,13 @@ static void aspeed_vic_class_init(ObjectClass *klass, const void *data)
349 dc->vmsd = &vmstate_aspeed_vic;
350 }
351
352 -static const TypeInfo aspeed_vic_info = {
353 - .name = TYPE_ASPEED_VIC,
354 - .parent = TYPE_SYS_BUS_DEVICE,
355 - .instance_size = sizeof(AspeedVICState),
356 - .class_init = aspeed_vic_class_init,
352 +static const TypeInfo aspeed_vic_types[] = {
353 + {
354 + .name = TYPE_ASPEED_VIC,
355 + .parent = TYPE_SYS_BUS_DEVICE,
356 + .instance_size = sizeof(AspeedVICState),
357 + .class_init = aspeed_vic_class_init,
358 + }
359 };
360
359 -static void aspeed_vic_register_types(void)
360 -{
361 - type_register_static(&aspeed_vic_info);
362 -}
363 -
364 -type_init(aspeed_vic_register_types);
361 +DEFINE_TYPES(aspeed_vic_types)