mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
sparc32_dma: use object link instead of qdev property to pass IOMMU reference
This enables us to remove the last remaining (opaque) qdev property. Whilst we are here, also update iommu_init() to use TYPE_SUN4M_IOMMU instead of a hardcoded string. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
9227f296a9
commit
f542ad0388
2 changed files with 7 additions and 10 deletions
|
|
@ -263,24 +263,21 @@ static void sparc32_dma_device_init(Object *obj)
|
|||
|
||||
sysbus_init_mmio(sbd, &s->iomem);
|
||||
|
||||
object_property_add_link(OBJECT(dev), "iommu", TYPE_SUN4M_IOMMU,
|
||||
(Object **) &s->iommu,
|
||||
qdev_prop_allow_set_link_before_realize,
|
||||
0, NULL);
|
||||
|
||||
qdev_init_gpio_in(dev, dma_set_irq, 1);
|
||||
qdev_init_gpio_out(dev, s->gpio, 2);
|
||||
}
|
||||
|
||||
static Property sparc32_dma_device_properties[] = {
|
||||
DEFINE_PROP_PTR("iommu_opaque", DMADeviceState, iommu),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void sparc32_dma_device_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->reset = sparc32_dma_device_reset;
|
||||
dc->vmsd = &vmstate_sparc32_dma_device;
|
||||
dc->props = sparc32_dma_device_properties;
|
||||
/* Reason: pointer property "iommu_opaque" */
|
||||
dc->user_creatable = false;
|
||||
}
|
||||
|
||||
static const TypeInfo sparc32_dma_device_info = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue