mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
cadence_gem: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
a054e2c2dd
commit
318643beaa
1 changed files with 15 additions and 11 deletions
|
@ -315,8 +315,12 @@ static inline void rx_desc_set_length(unsigned *desc, unsigned len)
|
||||||
desc[1] |= len;
|
desc[1] |= len;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
#define TYPE_CADENCE_GEM "cadence_gem"
|
||||||
SysBusDevice busdev;
|
#define GEM(obj) OBJECT_CHECK(GemState, (obj), TYPE_CADENCE_GEM)
|
||||||
|
|
||||||
|
typedef struct GemState {
|
||||||
|
SysBusDevice parent_obj;
|
||||||
|
|
||||||
MemoryRegion iomem;
|
MemoryRegion iomem;
|
||||||
NICState *nic;
|
NICState *nic;
|
||||||
NICConf conf;
|
NICConf conf;
|
||||||
|
@ -945,7 +949,7 @@ static void gem_phy_reset(GemState *s)
|
||||||
|
|
||||||
static void gem_reset(DeviceState *d)
|
static void gem_reset(DeviceState *d)
|
||||||
{
|
{
|
||||||
GemState *s = FROM_SYSBUS(GemState, SYS_BUS_DEVICE(d));
|
GemState *s = GEM(d);
|
||||||
|
|
||||||
DB_PRINT("\n");
|
DB_PRINT("\n");
|
||||||
|
|
||||||
|
@ -1155,22 +1159,22 @@ static NetClientInfo net_gem_info = {
|
||||||
.link_status_changed = gem_set_link,
|
.link_status_changed = gem_set_link,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int gem_init(SysBusDevice *dev)
|
static int gem_init(SysBusDevice *sbd)
|
||||||
{
|
{
|
||||||
GemState *s;
|
DeviceState *dev = DEVICE(sbd);
|
||||||
|
GemState *s = GEM(dev);
|
||||||
|
|
||||||
DB_PRINT("\n");
|
DB_PRINT("\n");
|
||||||
|
|
||||||
s = FROM_SYSBUS(GemState, dev);
|
|
||||||
gem_init_register_masks(s);
|
gem_init_register_masks(s);
|
||||||
memory_region_init_io(&s->iomem, OBJECT(s), &gem_ops, s,
|
memory_region_init_io(&s->iomem, OBJECT(s), &gem_ops, s,
|
||||||
"enet", sizeof(s->regs));
|
"enet", sizeof(s->regs));
|
||||||
sysbus_init_mmio(dev, &s->iomem);
|
sysbus_init_mmio(sbd, &s->iomem);
|
||||||
sysbus_init_irq(dev, &s->irq);
|
sysbus_init_irq(sbd, &s->irq);
|
||||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||||
|
|
||||||
s->nic = qemu_new_nic(&net_gem_info, &s->conf,
|
s->nic = qemu_new_nic(&net_gem_info, &s->conf,
|
||||||
object_get_typename(OBJECT(dev)), dev->qdev.id, s);
|
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1206,10 +1210,10 @@ static void gem_class_init(ObjectClass *klass, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo gem_info = {
|
static const TypeInfo gem_info = {
|
||||||
.class_init = gem_class_init,
|
.name = TYPE_CADENCE_GEM,
|
||||||
.name = "cadence_gem",
|
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_size = sizeof(GemState),
|
.instance_size = sizeof(GemState),
|
||||||
|
.class_init = gem_class_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gem_register_types(void)
|
static void gem_register_types(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue