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 <peter.crosthwaite@xilinx.com>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
This commit is contained in:
Peter Crosthwaite 2013-04-16 10:22:41 +10:00 committed by Edgar E. Iglesias
parent cbde584f58
commit 897374db7d

View File

@ -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;
}