diff options
author | Andreas Färber <afaerber@suse.de> | 2013-07-27 15:32:47 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-07-29 21:07:02 +0200 |
commit | 760d1d00b8148887003b0632da82dabab57d71f5 (patch) | |
tree | 1f38d17a09ab4a53ac8417dc73ea552f5821f486 /hw/timer/xilinx_timer.c | |
parent | 453be7a6fc21c5794e335d937c63bc9d49b1fe1a (diff) | |
download | qemu-760d1d00b8148887003b0632da82dabab57d71f5.zip qemu-760d1d00b8148887003b0632da82dabab57d71f5.tar.gz qemu-760d1d00b8148887003b0632da82dabab57d71f5.tar.bz2 |
xilinx_timer: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/timer/xilinx_timer.c')
-rw-r--r-- | hw/timer/xilinx_timer.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index ee53834..5f2c902 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -57,9 +57,14 @@ struct xlx_timer uint32_t regs[R_MAX]; }; +#define TYPE_XILINX_TIMER "xlnx.xps-timer" +#define XILINX_TIMER(obj) \ + OBJECT_CHECK(struct timerblock, (obj), TYPE_XILINX_TIMER) + struct timerblock { - SysBusDevice busdev; + SysBusDevice parent_obj; + MemoryRegion mmio; qemu_irq irq; uint8_t one_timer_only; @@ -200,7 +205,7 @@ static void timer_hit(void *opaque) static int xilinx_timer_init(SysBusDevice *dev) { - struct timerblock *t = FROM_SYSBUS(typeof (*t), dev); + struct timerblock *t = XILINX_TIMER(dev); unsigned int i; /* All timers share a single irq line. */ @@ -241,7 +246,7 @@ static void xilinx_timer_class_init(ObjectClass *klass, void *data) } static const TypeInfo xilinx_timer_info = { - .name = "xlnx.xps-timer", + .name = TYPE_XILINX_TIMER, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(struct timerblock), .class_init = xilinx_timer_class_init, |