summaryrefslogtreecommitdiffstats
path: root/hw/pci-host/bonito.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/pci-host/bonito.c')
-rw-r--r--hw/pci-host/bonito.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index f9697dcc43..1405b3fc70 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -40,6 +40,7 @@
#include "qemu/osdep.h"
#include "qemu/units.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "hw/pci/pci.h"
#include "hw/irq.h"
@@ -743,17 +744,17 @@ PCIBus *bonito_init(qemu_irq *pic)
PCIBonitoState *s;
PCIDevice *d;
- dev = qdev_create(NULL, TYPE_BONITO_PCI_HOST_BRIDGE);
+ dev = qdev_new(TYPE_BONITO_PCI_HOST_BRIDGE);
phb = PCI_HOST_BRIDGE(dev);
pcihost = BONITO_PCI_HOST_BRIDGE(dev);
pcihost->pic = pic;
- qdev_init_nofail(dev);
+ sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
- d = pci_create(phb->bus, PCI_DEVFN(0, 0), TYPE_PCI_BONITO);
+ d = pci_new(PCI_DEVFN(0, 0), TYPE_PCI_BONITO);
s = PCI_BONITO(d);
s->pcihost = pcihost;
pcihost->pci_dev = s;
- qdev_init_nofail(DEVICE(d));
+ pci_realize_and_unref(d, phb->bus, &error_fatal);
return phb->bus;
}