aboutsummaryrefslogtreecommitdiff
path: root/hw/char
diff options
context:
space:
mode:
Diffstat (limited to 'hw/char')
-rw-r--r--hw/char/exynos4210_uart.c5
-rw-r--r--hw/char/mcf_uart.c5
-rw-r--r--hw/char/spapr_vty.c4
3 files changed, 8 insertions, 6 deletions
diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c
index 96d5180..b86bd7b 100644
--- a/hw/char/exynos4210_uart.c
+++ b/hw/char/exynos4210_uart.c
@@ -22,6 +22,7 @@
#include "qemu/osdep.h"
#include "hw/sysbus.h"
#include "migration/vmstate.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "qemu/timer.h"
@@ -652,7 +653,7 @@ DeviceState *exynos4210_uart_create(hwaddr addr,
DeviceState *dev;
SysBusDevice *bus;
- dev = qdev_create(NULL, TYPE_EXYNOS4210_UART);
+ dev = qdev_new(TYPE_EXYNOS4210_UART);
qdev_prop_set_chr(dev, "chardev", chr);
qdev_prop_set_uint32(dev, "channel", channel);
@@ -660,7 +661,7 @@ DeviceState *exynos4210_uart_create(hwaddr addr,
qdev_prop_set_uint32(dev, "tx-size", fifo_size);
bus = SYS_BUS_DEVICE(dev);
- qdev_init_nofail(dev);
+ qdev_realize_and_unref(dev, NULL, &error_fatal);
if (addr != (hwaddr)-1) {
sysbus_mmio_map(bus, 0, addr);
}
diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c
index 97e4bbc..2ac0a19 100644
--- a/hw/char/mcf_uart.c
+++ b/hw/char/mcf_uart.c
@@ -10,6 +10,7 @@
#include "hw/irq.h"
#include "hw/sysbus.h"
#include "qemu/module.h"
+#include "qapi/error.h"
#include "hw/m68k/mcf.h"
#include "hw/qdev-properties.h"
#include "chardev/char-fe.h"
@@ -343,11 +344,11 @@ void *mcf_uart_init(qemu_irq irq, Chardev *chrdrv)
{
DeviceState *dev;
- dev = qdev_create(NULL, TYPE_MCF_UART);
+ dev = qdev_new(TYPE_MCF_UART);
if (chrdrv) {
qdev_prop_set_chr(dev, "chardev", chrdrv);
}
- qdev_init_nofail(dev);
+ qdev_realize_and_unref(dev, NULL, &error_fatal);
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq);
diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c
index ecb94f5..464a523 100644
--- a/hw/char/spapr_vty.c
+++ b/hw/char/spapr_vty.c
@@ -158,9 +158,9 @@ void spapr_vty_create(SpaprVioBus *bus, Chardev *chardev)
{
DeviceState *dev;
- dev = qdev_create(&bus->bus, "spapr-vty");
+ dev = qdev_new("spapr-vty");
qdev_prop_set_chr(dev, "chardev", chardev);
- qdev_init_nofail(dev);
+ qdev_realize_and_unref(dev, &bus->bus, &error_fatal);
}
static Property spapr_vty_properties[] = {