提交 3d29bcee 编写于 作者: A Andreas Färber

pl022: QOM cast cleanup

Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 ce556e0b
...@@ -39,8 +39,12 @@ do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__);} while (0) ...@@ -39,8 +39,12 @@ do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__);} while (0)
#define PL022_INT_RX 0x04 #define PL022_INT_RX 0x04
#define PL022_INT_TX 0x08 #define PL022_INT_TX 0x08
#define TYPE_PL022 "pl022"
#define PL022(obj) OBJECT_CHECK(PL022State, (obj), TYPE_PL022)
typedef struct PL022State { typedef struct PL022State {
SysBusDevice busdev; SysBusDevice parent_obj;
MemoryRegion iomem; MemoryRegion iomem;
uint32_t cr0; uint32_t cr0;
uint32_t cr1; uint32_t cr1;
...@@ -273,16 +277,17 @@ static const VMStateDescription vmstate_pl022 = { ...@@ -273,16 +277,17 @@ static const VMStateDescription vmstate_pl022 = {
} }
}; };
static int pl022_init(SysBusDevice *dev) static int pl022_init(SysBusDevice *sbd)
{ {
PL022State *s = FROM_SYSBUS(PL022State, dev); DeviceState *dev = DEVICE(sbd);
PL022State *s = PL022(dev);
memory_region_init_io(&s->iomem, OBJECT(s), &pl022_ops, s, "pl022", 0x1000); memory_region_init_io(&s->iomem, OBJECT(s), &pl022_ops, s, "pl022", 0x1000);
sysbus_init_mmio(dev, &s->iomem); sysbus_init_mmio(sbd, &s->iomem);
sysbus_init_irq(dev, &s->irq); sysbus_init_irq(sbd, &s->irq);
s->ssi = ssi_create_bus(&dev->qdev, "ssi"); s->ssi = ssi_create_bus(dev, "ssi");
pl022_reset(s); pl022_reset(s);
vmstate_register(&dev->qdev, -1, &vmstate_pl022, s); vmstate_register(dev, -1, &vmstate_pl022, s);
return 0; return 0;
} }
...@@ -294,7 +299,7 @@ static void pl022_class_init(ObjectClass *klass, void *data) ...@@ -294,7 +299,7 @@ static void pl022_class_init(ObjectClass *klass, void *data)
} }
static const TypeInfo pl022_info = { static const TypeInfo pl022_info = {
.name = "pl022", .name = TYPE_PL022,
.parent = TYPE_SYS_BUS_DEVICE, .parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(PL022State), .instance_size = sizeof(PL022State),
.class_init = pl022_class_init, .class_init = pl022_class_init,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册