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 <[email protected]>
---
 hw/arm/aspeed_ast1700.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/hw/arm/aspeed_ast1700.c b/hw/arm/aspeed_ast1700.c
index e90302c11b..5af5da5b8a 100644
--- a/hw/arm/aspeed_ast1700.c
+++ b/hw/arm/aspeed_ast1700.c
@@ -260,17 +260,14 @@ static void aspeed_ast1700_class_init(ObjectClass *klass, 
const void *data)
     device_class_set_props(dc, aspeed_ast1700_props);
 }
 
-static const TypeInfo aspeed_ast1700_info = {
-    .name          = TYPE_ASPEED_AST1700,
-    .parent        = TYPE_SYS_BUS_DEVICE,
-    .instance_size = sizeof(AspeedAST1700SoCState),
-    .class_init    = aspeed_ast1700_class_init,
-    .instance_init = aspeed_ast1700_instance_init,
+static const TypeInfo aspeed_ast1700_types[] = {
+    {
+        .name          = TYPE_ASPEED_AST1700,
+        .parent        = TYPE_SYS_BUS_DEVICE,
+        .instance_size = sizeof(AspeedAST1700SoCState),
+        .class_init    = aspeed_ast1700_class_init,
+        .instance_init = aspeed_ast1700_instance_init,
+    }
 };
 
-static void aspeed_ast1700_register_types(void)
-{
-    type_register_static(&aspeed_ast1700_info);
-}
-
-type_init(aspeed_ast1700_register_types);
+DEFINE_TYPES(aspeed_ast1700_types)
-- 
2.43.0

Reply via email to