From 0fc84331d631ea434fb846f4916f216aeb5b5f91 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Sun, 24 Sep 2017 15:47:43 +0100 Subject: macio: pass channel into MACIOIDEState via qdev property One of the reasons macio_ide_register_dma() needs to exist is because the channel id isn't passed into the MACIO_IDE object. Pass in the channel id using a qdev property to remove this requirement. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/misc/macio/macio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hw/misc/macio/macio.c') diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index f459f17f2f..41b377e7a0 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -159,7 +159,9 @@ static void macio_realize_ide(MacIOState *s, MACIOIDEState *ide, sysbus_dev = SYS_BUS_DEVICE(ide); sysbus_connect_irq(sysbus_dev, 0, irq0); sysbus_connect_irq(sysbus_dev, 1, irq1); - macio_ide_register_dma(ide, s->dbdma, dmaid); + qdev_prop_set_uint32(DEVICE(ide), "channel", dmaid); + macio_ide_register_dma(ide, s->dbdma); + object_property_set_bool(OBJECT(ide), true, "realized", errp); } -- cgit 1.4.1