sun4m: QOM cast cleanup for AFXState
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
ef9dfa4c1c
commit
b3a4996524
@ -612,8 +612,12 @@ static const TypeInfo idreg_info = {
|
|||||||
.class_init = idreg_class_init,
|
.class_init = idreg_class_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define TYPE_TCX_AFX "tcx_afx"
|
||||||
|
#define TCX_AFX(obj) OBJECT_CHECK(AFXState, (obj), TYPE_TCX_AFX)
|
||||||
|
|
||||||
typedef struct AFXState {
|
typedef struct AFXState {
|
||||||
SysBusDevice busdev;
|
SysBusDevice parent_obj;
|
||||||
|
|
||||||
MemoryRegion mem;
|
MemoryRegion mem;
|
||||||
} AFXState;
|
} AFXState;
|
||||||
|
|
||||||
@ -623,7 +627,7 @@ static void afx_init(hwaddr addr)
|
|||||||
DeviceState *dev;
|
DeviceState *dev;
|
||||||
SysBusDevice *s;
|
SysBusDevice *s;
|
||||||
|
|
||||||
dev = qdev_create(NULL, "tcx_afx");
|
dev = qdev_create(NULL, TYPE_TCX_AFX);
|
||||||
qdev_init_nofail(dev);
|
qdev_init_nofail(dev);
|
||||||
s = SYS_BUS_DEVICE(dev);
|
s = SYS_BUS_DEVICE(dev);
|
||||||
|
|
||||||
@ -632,7 +636,7 @@ static void afx_init(hwaddr addr)
|
|||||||
|
|
||||||
static int afx_init1(SysBusDevice *dev)
|
static int afx_init1(SysBusDevice *dev)
|
||||||
{
|
{
|
||||||
AFXState *s = FROM_SYSBUS(AFXState, dev);
|
AFXState *s = TCX_AFX(dev);
|
||||||
|
|
||||||
memory_region_init_ram(&s->mem, OBJECT(s), "sun4m.afx", 4);
|
memory_region_init_ram(&s->mem, OBJECT(s), "sun4m.afx", 4);
|
||||||
vmstate_register_ram_global(&s->mem);
|
vmstate_register_ram_global(&s->mem);
|
||||||
@ -648,7 +652,7 @@ static void afx_class_init(ObjectClass *klass, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo afx_info = {
|
static const TypeInfo afx_info = {
|
||||||
.name = "tcx_afx",
|
.name = TYPE_TCX_AFX,
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_size = sizeof(AFXState),
|
.instance_size = sizeof(AFXState),
|
||||||
.class_init = afx_class_init,
|
.class_init = afx_class_init,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user