aboutsummaryrefslogtreecommitdiff
path: root/hw/dma
diff options
context:
space:
mode:
Diffstat (limited to 'hw/dma')
-rw-r--r--hw/dma/pxa2xx_dma.c8
-rw-r--r--hw/dma/rc4030.c5
-rw-r--r--hw/dma/sparc32_dma.c16
3 files changed, 15 insertions, 14 deletions
diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c
index 8a2eeb3..6b761af 100644
--- a/hw/dma/pxa2xx_dma.c
+++ b/hw/dma/pxa2xx_dma.c
@@ -495,9 +495,9 @@ DeviceState *pxa27x_dma_init(hwaddr base, qemu_irq irq)
{
DeviceState *dev;
- dev = qdev_create(NULL, "pxa2xx-dma");
+ dev = qdev_new("pxa2xx-dma");
qdev_prop_set_int32(dev, "channels", PXA27X_DMA_NUM_CHANNELS);
- qdev_init_nofail(dev);
+ qdev_realize_and_unref(dev, NULL, &error_fatal);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq);
@@ -509,9 +509,9 @@ DeviceState *pxa255_dma_init(hwaddr base, qemu_irq irq)
{
DeviceState *dev;
- dev = qdev_create(NULL, "pxa2xx-dma");
+ dev = qdev_new("pxa2xx-dma");
qdev_prop_set_int32(dev, "channels", PXA27X_DMA_NUM_CHANNELS);
- qdev_init_nofail(dev);
+ qdev_realize_and_unref(dev, NULL, &error_fatal);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq);
diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c
index eefbabd..21c9706 100644
--- a/hw/dma/rc4030.c
+++ b/hw/dma/rc4030.c
@@ -28,6 +28,7 @@
#include "hw/mips/mips.h"
#include "hw/sysbus.h"
#include "migration/vmstate.h"
+#include "qapi/error.h"
#include "qemu/timer.h"
#include "qemu/log.h"
#include "qemu/module.h"
@@ -744,8 +745,8 @@ DeviceState *rc4030_init(rc4030_dma **dmas, IOMMUMemoryRegion **dma_mr)
{
DeviceState *dev;
- dev = qdev_create(NULL, TYPE_RC4030);
- qdev_init_nofail(dev);
+ dev = qdev_new(TYPE_RC4030);
+ qdev_realize_and_unref(dev, NULL, &error_fatal);
*dmas = rc4030_allocate_dmas(dev, 4);
*dma_mr = &RC4030(dev)->dma_mr;
diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c
index 84b9c5d..77cf41e 100644
--- a/hw/dma/sparc32_dma.c
+++ b/hw/dma/sparc32_dma.c
@@ -301,7 +301,7 @@ static void sparc32_espdma_device_realize(DeviceState *dev, Error **errp)
SysBusESPState *sysbus;
ESPState *esp;
- d = qdev_create(NULL, TYPE_ESP);
+ d = qdev_new(TYPE_ESP);
object_property_add_child(OBJECT(dev), "esp", OBJECT(d));
sysbus = ESP_STATE(d);
esp = &sysbus->esp;
@@ -310,7 +310,7 @@ static void sparc32_espdma_device_realize(DeviceState *dev, Error **errp)
esp->dma_opaque = SPARC32_DMA_DEVICE(dev);
sysbus->it_shift = 2;
esp->dma_enabled = 1;
- qdev_init_nofail(d);
+ qdev_realize_and_unref(d, NULL, &error_fatal);
}
static void sparc32_espdma_device_class_init(ObjectClass *klass, void *data)
@@ -343,11 +343,11 @@ static void sparc32_ledma_device_realize(DeviceState *dev, Error **errp)
qemu_check_nic_model(nd, TYPE_LANCE);
- d = qdev_create(NULL, TYPE_LANCE);
+ d = qdev_new(TYPE_LANCE);
object_property_add_child(OBJECT(dev), "lance", OBJECT(d));
qdev_set_nic_properties(d, nd);
object_property_set_link(OBJECT(d), OBJECT(dev), "dma", errp);
- qdev_init_nofail(d);
+ qdev_realize_and_unref(d, NULL, &error_fatal);
}
static void sparc32_ledma_device_class_init(ObjectClass *klass, void *data)
@@ -378,10 +378,10 @@ static void sparc32_dma_realize(DeviceState *dev, Error **errp)
return;
}
- espdma = qdev_create(NULL, TYPE_SPARC32_ESPDMA_DEVICE);
+ espdma = qdev_new(TYPE_SPARC32_ESPDMA_DEVICE);
object_property_set_link(OBJECT(espdma), iommu, "iommu", errp);
object_property_add_child(OBJECT(s), "espdma", OBJECT(espdma));
- qdev_init_nofail(espdma);
+ qdev_realize_and_unref(espdma, NULL, &error_fatal);
esp = DEVICE(object_resolve_path_component(OBJECT(espdma), "esp"));
sbd = SYS_BUS_DEVICE(esp);
@@ -393,10 +393,10 @@ static void sparc32_dma_realize(DeviceState *dev, Error **errp)
memory_region_add_subregion(&s->dmamem, 0x0,
sysbus_mmio_get_region(sbd, 0));
- ledma = qdev_create(NULL, TYPE_SPARC32_LEDMA_DEVICE);
+ ledma = qdev_new(TYPE_SPARC32_LEDMA_DEVICE);
object_property_set_link(OBJECT(ledma), iommu, "iommu", errp);
object_property_add_child(OBJECT(s), "ledma", OBJECT(ledma));
- qdev_init_nofail(ledma);
+ qdev_realize_and_unref(ledma, NULL, &error_fatal);
lance = DEVICE(object_resolve_path_component(OBJECT(ledma), "lance"));
sbd = SYS_BUS_DEVICE(lance);