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 <mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Mark Cave-Ayland 2017-09-24 15:47:43 +01:00 committed by David Gibson
parent ecba28dbf2
commit 0fc84331d6
3 changed files with 13 additions and 5 deletions

View file

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