hw/gpio/aspeed_sgpio: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 2 standalone TypeInfo variables (aspeed_sgpio_info and
aspeed_sgpio_ast2700_info) directly into the 'aspeed_sgpio_types[]'
array, removing the need for separate declarations.

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-14-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
Jamin Lin
2026-06-01 02:50:20 +00:00
committed by Cédric Le Goater
parent 4bf949e880
commit d024d4def7

View File

@@ -321,26 +321,21 @@ static void aspeed_sgpio_2700_class_init(ObjectClass *klass, const void *data)
agc->reg_ops = &aspeed_sgpio_2700_ops;
}
static const TypeInfo aspeed_sgpio_info = {
.name = TYPE_ASPEED_SGPIO,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(AspeedSGPIOState),
.class_size = sizeof(AspeedSGPIOClass),
.class_init = aspeed_sgpio_class_init,
.abstract = true,
static const TypeInfo aspeed_sgpio_types[] = {
{
.name = TYPE_ASPEED_SGPIO,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(AspeedSGPIOState),
.class_size = sizeof(AspeedSGPIOClass),
.class_init = aspeed_sgpio_class_init,
.abstract = true,
},
{
.name = TYPE_ASPEED_SGPIO "-ast2700",
.parent = TYPE_ASPEED_SGPIO,
.class_init = aspeed_sgpio_2700_class_init,
.instance_init = aspeed_sgpio_init,
}
};
static const TypeInfo aspeed_sgpio_ast2700_info = {
.name = TYPE_ASPEED_SGPIO "-ast2700",
.parent = TYPE_ASPEED_SGPIO,
.class_init = aspeed_sgpio_2700_class_init,
.instance_init = aspeed_sgpio_init,
};
static void aspeed_sgpio_register_types(void)
{
type_register_static(&aspeed_sgpio_info);
type_register_static(&aspeed_sgpio_ast2700_info);
}
type_init(aspeed_sgpio_register_types);
DEFINE_TYPES(aspeed_sgpio_types)