From 897374db7db10a9c17fd4da4e089705b553b4ee1 Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Tue, 16 Apr 2013 10:22:41 +1000 Subject: xilinx_axidma: Register reset properly Register the reset function as the Device::reset function rather than explicitly call it from the sysbus::init. Signed-off-by: Peter Crosthwaite Acked-by: Edgar E. Iglesias Signed-off-by: Edgar E. Iglesias --- hw/dma/xilinx_axidma.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'hw/dma') diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 0b5bb4490c..91b8f07dc1 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -357,6 +357,16 @@ static void stream_process_s2mem(struct Stream *s, } } +static void xilinx_axidma_reset(DeviceState *dev) +{ + int i; + XilinxAXIDMA *s = XILINX_AXI_DMA(dev); + + for (i = 0; i < 2; i++) { + stream_reset(&s->streams[i]); + } +} + static void axidma_push(StreamSlave *obj, unsigned char *buf, size_t len, uint32_t *app) { @@ -477,7 +487,6 @@ static int xilinx_axidma_init(SysBusDevice *dev) sysbus_init_mmio(dev, &s->iomem); for (i = 0; i < 2; i++) { - stream_reset(&s->streams[i]); s->streams[i].nr = i; s->streams[i].bh = qemu_bh_new(timer_hit, &s->streams[i]); s->streams[i].ptimer = ptimer_init(s->streams[i].bh); @@ -506,6 +515,7 @@ static void axidma_class_init(ObjectClass *klass, void *data) StreamSlaveClass *ssc = STREAM_SLAVE_CLASS(klass); k->init = xilinx_axidma_init; + dc->reset = xilinx_axidma_reset; dc->props = axidma_properties; ssc->push = axidma_push; } -- cgit v1.2.1