]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - drivers/pci/pci-uclass.c
dm: pci: Use the correct hose when configuring devices
[karo-tx-uboot.git] / drivers / pci / pci-uclass.c
index de8750546699e0a66a5d70d9652184d1c5ba448b..41d19cb37a936170d34e9e714be0ddea6b287194 100644 (file)
@@ -296,6 +296,7 @@ int pci_auto_config_devices(struct udevice *bus)
             !ret && dev;
             ret = device_find_next_child(&dev)) {
                struct pci_child_platdata *pplat;
+               struct pci_controller *ctlr_hose;
 
                pplat = dev_get_parent_platdata(dev);
                unsigned int max_bus;
@@ -303,7 +304,10 @@ int pci_auto_config_devices(struct udevice *bus)
 
                bdf = PCI_ADD_BUS(bus->seq, pplat->devfn);
                debug("%s: device %s\n", __func__, dev->name);
-               max_bus = pciauto_config_device(hose, bdf);
+
+               /* The root controller has the region information */
+               ctlr_hose = hose->ctlr->uclass_priv;
+               max_bus = pciauto_config_device(ctlr_hose, bdf);
                sub_bus = max(sub_bus, max_bus);
        }
        debug("%s: done\n", __func__);