mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
hw/fsi/aspeed_apb2opb: Convert to DEFINE_TYPES() with inlined TypeInfo
Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. This file contains two independent subsystems (aspeed_apb2opb and fsi_opb), each with its own type_init() call. Both are converted to separate DEFINE_TYPES() blocks to preserve the original registration boundary. Inline the standalone 'aspeed_apb2opb_info' and 'fsi_opb_info' TypeInfo variables directly into their respective types arrays, 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-21-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
committed by
Cédric Le Goater
parent
228ad5fac7
commit
b87f34aa9f
@@ -319,20 +319,17 @@ static void fsi_aspeed_apb2opb_class_init(ObjectClass *klass, const void *data)
|
||||
rc->phases.hold = fsi_aspeed_apb2opb_reset_hold;
|
||||
}
|
||||
|
||||
static const TypeInfo aspeed_apb2opb_info = {
|
||||
.name = TYPE_ASPEED_APB2OPB,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_init = fsi_aspeed_apb2opb_init,
|
||||
.instance_size = sizeof(AspeedAPB2OPBState),
|
||||
.class_init = fsi_aspeed_apb2opb_class_init,
|
||||
static const TypeInfo aspeed_apb2opb_types[] = {
|
||||
{
|
||||
.name = TYPE_ASPEED_APB2OPB,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_init = fsi_aspeed_apb2opb_init,
|
||||
.instance_size = sizeof(AspeedAPB2OPBState),
|
||||
.class_init = fsi_aspeed_apb2opb_class_init,
|
||||
}
|
||||
};
|
||||
|
||||
static void aspeed_apb2opb_register_types(void)
|
||||
{
|
||||
type_register_static(&aspeed_apb2opb_info);
|
||||
}
|
||||
|
||||
type_init(aspeed_apb2opb_register_types);
|
||||
DEFINE_TYPES(aspeed_apb2opb_types)
|
||||
|
||||
static void fsi_opb_init(Object *o)
|
||||
{
|
||||
@@ -363,17 +360,14 @@ static void fsi_opb_class_init(ObjectClass *klass, const void *data)
|
||||
bc->unrealize = fsi_opb_unrealize;
|
||||
}
|
||||
|
||||
static const TypeInfo opb_info = {
|
||||
.name = TYPE_OP_BUS,
|
||||
.parent = TYPE_BUS,
|
||||
.instance_init = fsi_opb_init,
|
||||
.instance_size = sizeof(OPBus),
|
||||
.class_init = fsi_opb_class_init,
|
||||
static const TypeInfo fsi_opb_types[] = {
|
||||
{
|
||||
.name = TYPE_OP_BUS,
|
||||
.parent = TYPE_BUS,
|
||||
.instance_init = fsi_opb_init,
|
||||
.instance_size = sizeof(OPBus),
|
||||
.class_init = fsi_opb_class_init,
|
||||
}
|
||||
};
|
||||
|
||||
static void fsi_opb_register_types(void)
|
||||
{
|
||||
type_register_static(&opb_info);
|
||||
}
|
||||
|
||||
type_init(fsi_opb_register_types);
|
||||
DEFINE_TYPES(fsi_opb_types)
|
||||
|
||||
Reference in New Issue
Block a user