summary refs log tree commit diff stats
path: root/hw/pci-bridge
diff options
context:
space:
mode:
Diffstat (limited to 'hw/pci-bridge')
-rw-r--r--hw/pci-bridge/dec.c6
-rw-r--r--hw/pci-bridge/pci_expander_bridge.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c
index 952bc71122..677a310b96 100644
--- a/hw/pci-bridge/dec.c
+++ b/hw/pci-bridge/dec.c
@@ -26,6 +26,7 @@
 #include "qemu/osdep.h"
 #include "dec.h"
 #include "hw/sysbus.h"
+#include "qapi/error.h"
 #include "qemu/module.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
@@ -81,11 +82,10 @@ PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
     PCIDevice *dev;
     PCIBridge *br;
 
-    dev = pci_create_multifunction(parent_bus, devfn, false,
-                                   "dec-21154-p2p-bridge");
+    dev = pci_new_multifunction(devfn, false, "dec-21154-p2p-bridge");
     br = PCI_BRIDGE(dev);
     pci_bridge_map_irq(br, "DEC 21154 PCI-PCI bridge", dec_map_irq);
-    qdev_init_nofail(&dev->qdev);
+    pci_realize_and_unref(dev, parent_bus, &error_fatal);
     return pci_bridge_get_sec_bus(br);
 }
 
diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index 47aaaf8fd1..22f9fc223b 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -231,12 +231,12 @@ static void pxb_dev_realize_common(PCIDevice *dev, bool pcie, Error **errp)
         dev_name = dev->qdev.id;
     }
 
-    ds = qdev_create(NULL, TYPE_PXB_HOST);
+    ds = qdev_new(TYPE_PXB_HOST);
     if (pcie) {
         bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_PCIE_BUS);
     } else {
         bus = pci_root_bus_new(ds, "pxb-internal", NULL, NULL, 0, TYPE_PXB_BUS);
-        bds = qdev_create(BUS(bus), "pci-bridge");
+        bds = qdev_new("pci-bridge");
         bds->id = dev_name;
         qdev_prop_set_uint8(bds, PCI_BRIDGE_DEV_PROP_CHASSIS_NR, pxb->bus_nr);
         qdev_prop_set_bit(bds, PCI_BRIDGE_DEV_PROP_SHPC, false);
@@ -255,9 +255,9 @@ static void pxb_dev_realize_common(PCIDevice *dev, bool pcie, Error **errp)
         goto err_register_bus;
     }
 
-    qdev_init_nofail(ds);
+    sysbus_realize_and_unref(SYS_BUS_DEVICE(ds), &error_fatal);
     if (bds) {
-        qdev_init_nofail(bds);
+        qdev_realize_and_unref(bds, &bus->qbus, &error_fatal);
     }
 
     pci_word_test_and_set_mask(dev->config + PCI_STATUS,