@samitouri / QOSamiQemu / commits / c8ec9605b8

hw/nvram/aspeed_otp: 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_otp_info' TypeInfo variable directly into the 'aspeed_otp_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-19-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Jamin Lin committed Jun 1, 2026 at 02:50 UTC c8ec9605b8a4f5e0f07e275bb811aba2dad6bd68
1 file changed +8 -11
hw/nvram/aspeed_otp.c
+8 -11
@@ -174,16 +174,13 @@ static void aspeed_otp_class_init(ObjectClass *klass, const void *data)
174 device_class_set_props(dc, aspeed_otp_properties);
175 }
176
177 -static const TypeInfo aspeed_otp_info = {
178 - .name = TYPE_ASPEED_OTP,
179 - .parent = TYPE_DEVICE,
180 - .instance_size = sizeof(AspeedOTPState),
181 - .class_init = aspeed_otp_class_init,
177 +static const TypeInfo aspeed_otp_types[] = {
178 + {
179 + .name = TYPE_ASPEED_OTP,
180 + .parent = TYPE_DEVICE,
181 + .instance_size = sizeof(AspeedOTPState),
182 + .class_init = aspeed_otp_class_init,
183 + }
184 };
185
184 -static void aspeed_otp_register_types(void)
185 -{
186 - type_register_static(&aspeed_otp_info);
187 -}
188 -
189 -type_init(aspeed_otp_register_types)
186 +DEFINE_TYPES(aspeed_otp_types)