@samitouri / QOSamiQemu / commits / 5e5a1cfc7d

hw/arm/aspeed_ast1700: 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 TypeInfo variable directly into the 'aspeed_ast1700_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-12-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Jamin Lin committed Jun 1, 2026 at 02:50 UTC 5e5a1cfc7d87495b6ec64aba69e09bbf85bc5348
1 file changed +9 -12
hw/arm/aspeed_ast1700.c
+9 -12
@@ -260,17 +260,14 @@ static void aspeed_ast1700_class_init(ObjectClass *klass, const void *data)
260 device_class_set_props(dc, aspeed_ast1700_props);
261 }
262
263 -static const TypeInfo aspeed_ast1700_info = {
264 - .name = TYPE_ASPEED_AST1700,
265 - .parent = TYPE_SYS_BUS_DEVICE,
266 - .instance_size = sizeof(AspeedAST1700SoCState),
267 - .class_init = aspeed_ast1700_class_init,
268 - .instance_init = aspeed_ast1700_instance_init,
263 +static const TypeInfo aspeed_ast1700_types[] = {
264 + {
265 + .name = TYPE_ASPEED_AST1700,
266 + .parent = TYPE_SYS_BUS_DEVICE,
267 + .instance_size = sizeof(AspeedAST1700SoCState),
268 + .class_init = aspeed_ast1700_class_init,
269 + .instance_init = aspeed_ast1700_instance_init,
270 + }
271 };
272
271 -static void aspeed_ast1700_register_types(void)
272 -{
273 - type_register_static(&aspeed_ast1700_info);
274 -}
275 -
276 -type_init(aspeed_ast1700_register_types);
273 +DEFINE_TYPES(aspeed_ast1700_types)