[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 084/173] gpio/zaurus: QOM cast cleanup
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 084/173] gpio/zaurus: QOM cast cleanup |
Date: |
Mon, 29 Jul 2013 21:19:01 +0200 |
Signed-off-by: Andreas Färber <address@hidden>
---
hw/gpio/zaurus.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/hw/gpio/zaurus.c b/hw/gpio/zaurus.c
index c235c3e..dc79a8b 100644
--- a/hw/gpio/zaurus.c
+++ b/hw/gpio/zaurus.c
@@ -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,
--
1.8.1.4
- [Qemu-devel] [PULL 076/173] pxa2xx_dma: QOM cast cleanup, (continued)
- [Qemu-devel] [PULL 076/173] pxa2xx_dma: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 077/173] sparc32_dma: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 079/173] omap_gpio: QOM cast cleanup for omap_gpif_s, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 080/173] omap_gpio: QOM cast cleanup for omap2_gpif_s, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 078/173] sun4m_iommu: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 081/173] pl061: Rename pl061_state to PL061State, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 083/173] puv3_gpio: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 085/173] bitbang_i2c: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 082/173] pl061: QOM'ify pl061 and pl061_luminary, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 086/173] omap_i2c: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 084/173] gpio/zaurus: QOM cast cleanup,
Andreas Färber <=
- [Qemu-devel] [PULL 087/173] versatile_i2c: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 088/173] milkymist-softusb: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 090/173] pl050: QOM'ify pl050_keyboard and pl050_mouse, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 091/173] arm_gic: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 089/173] pl050: Rename pl050_state to PL050State, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 092/173] etraxfs_pic: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 093/173] exynos4210_combiner: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 096/173] grlib_irqmp: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 094/173] exynos4210_gic: QOM cast cleanup for exynos4210.gic, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 095/173] exynos4210_gic: QOM cast cleanup for exynos4210.irq_gate, Andreas Färber, 2013/07/29