@samitouri / QOSamiQemu / commits / a2b254e3e7

hw/misc/aspeed_pwm: 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_pwm_info' TypeInfo variable directly into the 'aspeed_pwm_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-5-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Jamin Lin committed Jun 1, 2026 at 02:50 UTC a2b254e3e75a4ab4b70cd5b2ca5805e27a2f745b
1 file changed +8 -11
hw/misc/aspeed_pwm.c
+8 -11
@@ -106,16 +106,13 @@ static void aspeed_pwm_class_init(ObjectClass *klass, const void *data)
106 dc->vmsd = &vmstate_aspeed_pwm;
107 }
108
109 -static const TypeInfo aspeed_pwm_info = {
110 - .name = TYPE_ASPEED_PWM,
111 - .parent = TYPE_SYS_BUS_DEVICE,
112 - .instance_size = sizeof(AspeedPWMState),
113 - .class_init = aspeed_pwm_class_init,
109 +static const TypeInfo aspeed_pwm_types[] = {
110 + {
111 + .name = TYPE_ASPEED_PWM,
112 + .parent = TYPE_SYS_BUS_DEVICE,
113 + .instance_size = sizeof(AspeedPWMState),
114 + .class_init = aspeed_pwm_class_init,
115 + }
116 };
117
116 -static void aspeed_pwm_register_types(void)
117 -{
118 - type_register_static(&aspeed_pwm_info);
119 -}
120 -
121 -type_init(aspeed_pwm_register_types);
118 +DEFINE_TYPES(aspeed_pwm_types)