@samitouri / QOSamiQemu / commits / 607659c510

hw/rtc/aspeed_rtc: 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 '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 <jamin_lin@aspeedtech.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-17-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Jamin Lin committed Jun 1, 2026 at 02:50 UTC 607659c510598f6d15f030bfc7db3fb561dc73b8
1 file changed +8 -11
hw/rtc/aspeed_rtc.c
+8 -11
@@ -166,16 +166,13 @@ static void aspeed_rtc_class_init(ObjectClass *klass, const void *data)
166 rc->phases.hold = aspeed_rtc_reset_hold;
167 }
168
169 -static const TypeInfo aspeed_rtc_info = {
170 - .name = TYPE_ASPEED_RTC,
171 - .parent = TYPE_SYS_BUS_DEVICE,
172 - .instance_size = sizeof(AspeedRtcState),
173 - .class_init = aspeed_rtc_class_init,
169 +static const TypeInfo aspeed_rtc_types[] = {
170 + {
171 + .name = TYPE_ASPEED_RTC,
172 + .parent = TYPE_SYS_BUS_DEVICE,
173 + .instance_size = sizeof(AspeedRtcState),
174 + .class_init = aspeed_rtc_class_init,
175 + }
176 };
177
176 -static void aspeed_rtc_register_types(void)
177 -{
178 - type_register_static(&aspeed_rtc_info);
179 -}
180 -
181 -type_init(aspeed_rtc_register_types)
178 +DEFINE_TYPES(aspeed_rtc_types)