@samitouri / QOSamiQemu / commits / a25f8521ed

hw/misc/aspeed_lpc: 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_lpc_info' TypeInfo variable directly into the 'aspeed_lpc_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-3-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Jamin Lin committed Jun 1, 2026 at 02:50 UTC a25f8521ed69a11ae65d1ca3e7e91ef788a1bdfb
1 file changed +9 -12
hw/misc/aspeed_lpc.c
+9 -12
@@ -470,17 +470,14 @@ static void aspeed_lpc_class_init(ObjectClass *klass, const void *data)
470 device_class_set_props(dc, aspeed_lpc_properties);
471 }
472
473 -static const TypeInfo aspeed_lpc_info = {
474 - .name = TYPE_ASPEED_LPC,
475 - .parent = TYPE_SYS_BUS_DEVICE,
476 - .instance_size = sizeof(AspeedLPCState),
477 - .class_init = aspeed_lpc_class_init,
478 - .instance_init = aspeed_lpc_init,
473 +static const TypeInfo aspeed_lpc_types[] = {
474 + {
475 + .name = TYPE_ASPEED_LPC,
476 + .parent = TYPE_SYS_BUS_DEVICE,
477 + .instance_size = sizeof(AspeedLPCState),
478 + .class_init = aspeed_lpc_class_init,
479 + .instance_init = aspeed_lpc_init,
480 + }
481 };
482
481 -static void aspeed_lpc_register_types(void)
482 -{
483 - type_register_static(&aspeed_lpc_info);
484 -}
485 -
486 -type_init(aspeed_lpc_register_types);
483 +DEFINE_TYPES(aspeed_lpc_types)