diff options
-rw-r--r-- | hw/ide/macio.c | 9 | ||||
-rw-r--r-- | hw/misc/macio/macio.c | 3 | ||||
-rw-r--r-- | hw/ppc/mac.h | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/hw/ide/macio.c b/hw/ide/macio.c index 19d5f5a8b3..ce194c6cec 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -450,6 +450,10 @@ static void macio_ide_initfn(Object *obj) sysbus_init_irq(d, &s->real_dma_irq); s->dma_irq = qemu_allocate_irq(pmac_ide_irq, s, 0); s->ide_irq = qemu_allocate_irq(pmac_ide_irq, s, 1); + + object_property_add_link(obj, "dbdma", TYPE_MAC_DBDMA, + (Object **) &s->dbdma, + qdev_prop_allow_set_link_before_realize, 0, NULL); } static Property macio_ide_properties[] = { @@ -493,10 +497,9 @@ void macio_ide_init_drives(MACIOIDEState *s, DriveInfo **hd_table) } } -void macio_ide_register_dma(MACIOIDEState *s, void *dbdma) +void macio_ide_register_dma(MACIOIDEState *s) { - s->dbdma = dbdma; - DBDMA_register_channel(dbdma, s->channel, s->dma_irq, + DBDMA_register_channel(s->dbdma, s->channel, s->dma_irq, pmac_ide_transfer, pmac_ide_flush, s); } diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index 41b377e7a0..9aa7e7559b 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -160,7 +160,8 @@ static void macio_realize_ide(MacIOState *s, MACIOIDEState *ide, sysbus_connect_irq(sysbus_dev, 0, irq0); sysbus_connect_irq(sysbus_dev, 1, irq1); qdev_prop_set_uint32(DEVICE(ide), "channel", dmaid); - macio_ide_register_dma(ide, s->dbdma); + object_property_set_link(OBJECT(ide), OBJECT(s->dbdma), "dbdma", errp); + macio_ide_register_dma(ide); object_property_set_bool(OBJECT(ide), true, "realized", errp); } diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index b3a26c49c1..b501af1653 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -147,7 +147,7 @@ typedef struct MACIOIDEState { } MACIOIDEState; void macio_ide_init_drives(MACIOIDEState *ide, DriveInfo **hd_table); -void macio_ide_register_dma(MACIOIDEState *ide, void *dbdma); +void macio_ide_register_dma(MACIOIDEState *ide); void macio_init(PCIDevice *dev, MemoryRegion *pic_mem, |