diff options
Diffstat (limited to 'hw/pci-host')
-rw-r--r-- | hw/pci-host/pnv_phb3.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index a52aedc..7fb35dc 100644 --- a/hw/pci-host/pnv_phb3.c +++ b/hw/pci-host/pnv_phb3.c @@ -993,6 +993,9 @@ static void pnv_phb3_realize(DeviceState *dev, Error **errp) /* User created devices */ if (!phb->chip) { + Error *local_err = NULL; + BusState *s; + phb->chip = pnv_get_chip(pnv, phb->chip_id); if (!phb->chip) { error_setg(errp, "invalid chip id: %d", phb->chip_id); @@ -1004,6 +1007,12 @@ static void pnv_phb3_realize(DeviceState *dev, Error **errp) * correctly the device tree. */ pnv_chip_parent_fixup(phb->chip, OBJECT(phb), phb->phb_id); + + s = qdev_get_parent_bus(DEVICE(phb->chip)); + if (!qdev_set_parent_bus(DEVICE(phb), s, &local_err)) { + error_propagate(errp, local_err); + return; + } } if (phb->phb_id >= PNV_CHIP_GET_CLASS(phb->chip)->num_phbs) { |