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 <[email protected]> --- hw/misc/aspeed_ltpi.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/misc/aspeed_ltpi.c b/hw/misc/aspeed_ltpi.c index 956e91d143..2e413550b9 100644 --- a/hw/misc/aspeed_ltpi.c +++ b/hw/misc/aspeed_ltpi.c @@ -179,16 +179,13 @@ static void aspeed_ltpi_class_init(ObjectClass *klass, const void *data) rc->phases.hold = aspeed_ltpi_reset_hold; } -static const TypeInfo aspeed_ltpi_info = { - .name = TYPE_ASPEED_LTPI, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(AspeedLTPIState), - .class_init = aspeed_ltpi_class_init, +static const TypeInfo aspeed_ltpi_types[] = { + { + .name = TYPE_ASPEED_LTPI, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(AspeedLTPIState), + .class_init = aspeed_ltpi_class_init, + } }; -static void aspeed_ltpi_register_types(void) -{ - type_register_static(&aspeed_ltpi_info); -} - -type_init(aspeed_ltpi_register_types); +DEFINE_TYPES(aspeed_ltpi_types) -- 2.43.0
