gpio/zaurus: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
1ed09e2f43
commit
a009de46bd
@ -24,9 +24,13 @@
|
||||
|
||||
/* SCOOP devices */
|
||||
|
||||
#define TYPE_SCOOP "scoop"
|
||||
#define SCOOP(obj) OBJECT_CHECK(ScoopInfo, (obj), TYPE_SCOOP)
|
||||
|
||||
typedef struct ScoopInfo ScoopInfo;
|
||||
struct ScoopInfo {
|
||||
SysBusDevice busdev;
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
qemu_irq handler[16];
|
||||
MemoryRegion iomem;
|
||||
uint16_t status;
|
||||
@ -162,16 +166,17 @@ static void scoop_gpio_set(void *opaque, int line, int level)
|
||||
s->gpio_level &= ~(1 << line);
|
||||
}
|
||||
|
||||
static int scoop_init(SysBusDevice *dev)
|
||||
static int scoop_init(SysBusDevice *sbd)
|
||||
{
|
||||
ScoopInfo *s = FROM_SYSBUS(ScoopInfo, dev);
|
||||
DeviceState *dev = DEVICE(sbd);
|
||||
ScoopInfo *s = SCOOP(dev);
|
||||
|
||||
s->status = 0x02;
|
||||
qdev_init_gpio_out(&s->busdev.qdev, s->handler, 16);
|
||||
qdev_init_gpio_in(&s->busdev.qdev, scoop_gpio_set, 16);
|
||||
qdev_init_gpio_out(dev, s->handler, 16);
|
||||
qdev_init_gpio_in(dev, scoop_gpio_set, 16);
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &scoop_ops, s, "scoop", 0x1000);
|
||||
|
||||
sysbus_init_mmio(dev, &s->iomem);
|
||||
sysbus_init_mmio(sbd, &s->iomem);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -237,7 +242,7 @@ static void scoop_sysbus_class_init(ObjectClass *klass, void *data)
|
||||
}
|
||||
|
||||
static const TypeInfo scoop_sysbus_info = {
|
||||
.name = "scoop",
|
||||
.name = TYPE_SCOOP,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(ScoopInfo),
|
||||
.class_init = scoop_sysbus_class_init,
|
||||
|
Loading…
Reference in New Issue
Block a user