[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 145/173] arm_timer: QOM cast cleanup for SP804State
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 145/173] arm_timer: QOM cast cleanup for SP804State |
Date: |
Mon, 29 Jul 2013 21:20:02 +0200 |
Signed-off-by: Andreas Färber <address@hidden>
---
hw/timer/arm_timer.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c
index 25e8890..8d95743 100644
--- a/hw/timer/arm_timer.c
+++ b/hw/timer/arm_timer.c
@@ -179,8 +179,12 @@ static arm_timer_state *arm_timer_init(uint32_t freq)
*
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0271d/index.html
*/
+#define TYPE_SP804 "sp804"
+#define SP804(obj) OBJECT_CHECK(SP804State, (obj), TYPE_SP804)
+
typedef struct SP804State {
- SysBusDevice busdev;
+ SysBusDevice parent_obj;
+
MemoryRegion iomem;
arm_timer_state *timer[2];
uint32_t freq0, freq1;
@@ -273,21 +277,22 @@ static const VMStateDescription vmstate_sp804 = {
}
};
-static int sp804_init(SysBusDevice *dev)
+static int sp804_init(SysBusDevice *sbd)
{
- SP804State *s = FROM_SYSBUS(SP804State, dev);
+ DeviceState *dev = DEVICE(sbd);
+ SP804State *s = SP804(dev);
qemu_irq *qi;
qi = qemu_allocate_irqs(sp804_set_irq, s, 2);
- sysbus_init_irq(dev, &s->irq);
+ sysbus_init_irq(sbd, &s->irq);
s->timer[0] = arm_timer_init(s->freq0);
s->timer[1] = arm_timer_init(s->freq1);
s->timer[0]->irq = qi[0];
s->timer[1]->irq = qi[1];
memory_region_init_io(&s->iomem, OBJECT(s), &sp804_ops, s,
"sp804", 0x1000);
- sysbus_init_mmio(dev, &s->iomem);
- vmstate_register(&dev->qdev, -1, &vmstate_sp804, s);
+ sysbus_init_mmio(sbd, &s->iomem);
+ vmstate_register(dev, -1, &vmstate_sp804, s);
return 0;
}
@@ -386,7 +391,7 @@ static void sp804_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo sp804_info = {
- .name = "sp804",
+ .name = TYPE_SP804,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(SP804State),
.class_init = sp804_class_init,
--
1.8.1.4
- [Qemu-devel] [PULL 136/173] sun4m: QOM cast cleanup for AFXState, (continued)
- [Qemu-devel] [PULL 136/173] sun4m: QOM cast cleanup for AFXState, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 135/173] sun4m: QOM cast cleanup for IDRegState, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 138/173] sun4m: QOM cast cleanup for RamDevice, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 137/173] sun4m: QOM cast cleanup for PROMState, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 139/173] sun4u: QOM cast cleanup for PROMState, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 140/173] sun4u: QOM cast cleanup for RamDevice, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 141/173] pl022: Rename pl022_state to PL022State, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 142/173] pl022: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 144/173] arm_timer: Rename sp804_state to SP804State, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 143/173] xilinx_spi: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 145/173] arm_timer: QOM cast cleanup for SP804State,
Andreas Färber <=
- [Qemu-devel] [PULL 146/173] arm_timer: QOM cast cleanup for icp_pit_state, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 147/173] cadence_ttc: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 148/173] etraxfs_timer: Rename etrax_timer to ETRAXTimerState, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 150/173] exynos4210_mct: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 149/173] etraxfs_timer: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 152/173] exynos4210_rtc: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 151/173] exynos4210_pwm: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 153/173] grlib_gptimer: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 154/173] lm32_timer: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 155/173] m48t59: QOM cast cleanup for M48t59SysBusState, Andreas Färber, 2013/07/29