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>
---
hw/misc/aspeed_lpc.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/hw/misc/aspeed_lpc.c b/hw/misc/aspeed_lpc.c
index f69c48da12..7f7e4f1a09 100644
--- a/hw/misc/aspeed_lpc.c
+++ b/hw/misc/aspeed_lpc.c
@@ -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)
--
2.43.0