hw/misc/aspeed_ltpi: 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_ltpi_info' TypeInfo variable directly into the 'aspeed_ltpi_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-4-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
Jamin Lin committed
Jun 1, 2026 at 02:50 UTC
76338e5ed0ee1afb94f66bd0d4e38b7559bdbdf0
1 file changed
+8
-11
hw/misc/aspeed_ltpi.c
+8
-11
@@ -179,16 +179,13 @@ static void aspeed_ltpi_class_init(ObjectClass *klass, const void *data)
179
rc->phases.hold = aspeed_ltpi_reset_hold;
180
}
181
182
-static const TypeInfo aspeed_ltpi_info = {
183
- .name = TYPE_ASPEED_LTPI,
184
- .parent = TYPE_SYS_BUS_DEVICE,
185
- .instance_size = sizeof(AspeedLTPIState),
186
- .class_init = aspeed_ltpi_class_init,
182
+static const TypeInfo aspeed_ltpi_types[] = {
183
+ {
184
+ .name = TYPE_ASPEED_LTPI,
185
+ .parent = TYPE_SYS_BUS_DEVICE,
186
+ .instance_size = sizeof(AspeedLTPIState),
187
+ .class_init = aspeed_ltpi_class_init,
188
+ }
189
};
190
189
-static void aspeed_ltpi_register_types(void)
190
-{
191
- type_register_static(&aspeed_ltpi_info);
192
-}
193
-
194
-type_init(aspeed_ltpi_register_types);
191
+DEFINE_TYPES(aspeed_ltpi_types)