]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/misc/aspeed_lpc: Convert to DEFINE_TYPES() with inlined TypeInfo
authorJamin Lin <jamin_lin@aspeedtech.com>
Mon, 1 Jun 2026 02:50:04 +0000 (02:50 +0000)
committerCédric Le Goater <clg@redhat.com>
Sun, 7 Jun 2026 04:41:09 +0000 (06:41 +0200)
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>
hw/misc/aspeed_lpc.c

index f69c48da125c61854ef0092fa45bb93c3b67f324..7f7e4f1a09856a9ac6f7c3136b975d9396a24eb0 100644 (file)
@@ -470,17 +470,14 @@ static void aspeed_lpc_class_init(ObjectClass *klass, const void *data)
     device_class_set_props(dc, aspeed_lpc_properties);
 }
 
-static const TypeInfo aspeed_lpc_info = {
-    .name = TYPE_ASPEED_LPC,
-    .parent = TYPE_SYS_BUS_DEVICE,
-    .instance_size = sizeof(AspeedLPCState),
-    .class_init = aspeed_lpc_class_init,
-    .instance_init = aspeed_lpc_init,
+static const TypeInfo aspeed_lpc_types[] = {
+    {
+        .name = TYPE_ASPEED_LPC,
+        .parent = TYPE_SYS_BUS_DEVICE,
+        .instance_size = sizeof(AspeedLPCState),
+        .class_init = aspeed_lpc_class_init,
+        .instance_init = aspeed_lpc_init,
+    }
 };
 
-static void aspeed_lpc_register_types(void)
-{
-    type_register_static(&aspeed_lpc_info);
-}
-
-type_init(aspeed_lpc_register_types);
+DEFINE_TYPES(aspeed_lpc_types)