diff options
author | Andreas Färber <afaerber@suse.de> | 2013-07-27 14:45:47 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-07-29 21:07:01 +0200 |
commit | 25fce9ad7f7b77d610504e70b03e29630d66dfa9 (patch) | |
tree | 00026831b22795f6230dd931012684fdca432250 | |
parent | 81e1010d0fbfaa5992cffa88e1797af36cc438ef (diff) |
exynos4210_pwm: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r-- | hw/timer/exynos4210_pwm.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/timer/exynos4210_pwm.c b/hw/timer/exynos4210_pwm.c index 8fa0bb2b8f..a52f0f6c6b 100644 --- a/hw/timer/exynos4210_pwm.c +++ b/hw/timer/exynos4210_pwm.c @@ -97,9 +97,13 @@ typedef struct { } Exynos4210PWM; +#define TYPE_EXYNOS4210_PWM "exynos4210.pwm" +#define EXYNOS4210_PWM(obj) \ + OBJECT_CHECK(Exynos4210PWMState, (obj), TYPE_EXYNOS4210_PWM) typedef struct Exynos4210PWMState { - SysBusDevice busdev; + SysBusDevice parent_obj; + MemoryRegion iomem; uint32_t reg_tcfg[2]; @@ -352,7 +356,7 @@ static void exynos4210_pwm_write(void *opaque, hwaddr offset, */ static void exynos4210_pwm_reset(DeviceState *d) { - Exynos4210PWMState *s = (Exynos4210PWMState *)d; + Exynos4210PWMState *s = EXYNOS4210_PWM(d); int i; s->reg_tcfg[0] = 0x0101; s->reg_tcfg[1] = 0x0; @@ -378,7 +382,7 @@ static const MemoryRegionOps exynos4210_pwm_ops = { */ static int exynos4210_pwm_init(SysBusDevice *dev) { - Exynos4210PWMState *s = FROM_SYSBUS(Exynos4210PWMState, dev); + Exynos4210PWMState *s = EXYNOS4210_PWM(dev); int i; QEMUBH *bh; @@ -408,7 +412,7 @@ static void exynos4210_pwm_class_init(ObjectClass *klass, void *data) } static const TypeInfo exynos4210_pwm_info = { - .name = "exynos4210.pwm", + .name = TYPE_EXYNOS4210_PWM, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(Exynos4210PWMState), .class_init = exynos4210_pwm_class_init, |