mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
hw/net/ftgmac100: 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 (ftgmac100_info, aspeed_mii_info) directly into the 'ftgmac100_types[]' array, removing the need for separate declarations. Note that this file covers both the Faraday FTGMAC100 Gigabit Ethernet controller and the Aspeed MII controller, which share the same type registration. 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-24-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
43aa089b89
commit
2bdecefe9b
@@ -1279,12 +1279,6 @@ static void ftgmac100_class_init(ObjectClass *klass, const void *data)
|
||||
dc->desc = "Faraday FTGMAC100 Gigabit Ethernet emulation";
|
||||
}
|
||||
|
||||
static const TypeInfo ftgmac100_info = {
|
||||
.name = TYPE_FTGMAC100,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(FTGMAC100State),
|
||||
.class_init = ftgmac100_class_init,
|
||||
};
|
||||
|
||||
/*
|
||||
* AST2600 MII controller
|
||||
@@ -1438,17 +1432,19 @@ static void aspeed_mii_class_init(ObjectClass *klass, const void *data)
|
||||
device_class_set_props(dc, aspeed_mii_properties);
|
||||
}
|
||||
|
||||
static const TypeInfo aspeed_mii_info = {
|
||||
.name = TYPE_ASPEED_MII,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(AspeedMiiState),
|
||||
.class_init = aspeed_mii_class_init,
|
||||
static const TypeInfo ftgmac100_types[] = {
|
||||
{
|
||||
.name = TYPE_FTGMAC100,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(FTGMAC100State),
|
||||
.class_init = ftgmac100_class_init,
|
||||
},
|
||||
{
|
||||
.name = TYPE_ASPEED_MII,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(AspeedMiiState),
|
||||
.class_init = aspeed_mii_class_init,
|
||||
}
|
||||
};
|
||||
|
||||
static void ftgmac100_register_types(void)
|
||||
{
|
||||
type_register_static(&ftgmac100_info);
|
||||
type_register_static(&aspeed_mii_info);
|
||||
}
|
||||
|
||||
type_init(ftgmac100_register_types)
|
||||
DEFINE_TYPES(ftgmac100_types)
|
||||
|
||||
Reference in New Issue
Block a user