Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline the standalone 'aspeed_rtc_info' TypeInfo variable directly
into the 'aspeed_rtc_types[]' array, removing the need for a separate
declaration.

No functional change.

Signed-off-by: Jamin Lin <[email protected]>
---
 hw/rtc/aspeed_rtc.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/hw/rtc/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c
index 5245f3f956..34d9fcfa36 100644
--- a/hw/rtc/aspeed_rtc.c
+++ b/hw/rtc/aspeed_rtc.c
@@ -166,16 +166,13 @@ static void aspeed_rtc_class_init(ObjectClass *klass, 
const void *data)
     rc->phases.hold = aspeed_rtc_reset_hold;
 }
 
-static const TypeInfo aspeed_rtc_info = {
-    .name          = TYPE_ASPEED_RTC,
-    .parent        = TYPE_SYS_BUS_DEVICE,
-    .instance_size = sizeof(AspeedRtcState),
-    .class_init    = aspeed_rtc_class_init,
+static const TypeInfo aspeed_rtc_types[] = {
+    {
+        .name          = TYPE_ASPEED_RTC,
+        .parent        = TYPE_SYS_BUS_DEVICE,
+        .instance_size = sizeof(AspeedRtcState),
+        .class_init    = aspeed_rtc_class_init,
+    }
 };
 
-static void aspeed_rtc_register_types(void)
-{
-    type_register_static(&aspeed_rtc_info);
-}
-
-type_init(aspeed_rtc_register_types)
+DEFINE_TYPES(aspeed_rtc_types)
-- 
2.43.0

Reply via email to