Merge tag 'for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
[firefly-linux-kernel-4.4.55.git] / arch / powerpc / kernel / pci-common.c
index edef9afd8858b810fe530e290c11d594c2e1c8e0..2aa04f29e1de95d89f295c190bb56754ba84efd7 100644 (file)
@@ -200,11 +200,6 @@ int pcibios_add_platform_entries(struct pci_dev *pdev)
        return device_create_file(&pdev->dev, &dev_attr_devspec);
 }
 
-char __devinit *pcibios_setup(char *str)
-{
-       return str;
-}
-
 /*
  * Reads the interrupt pin to determine if interrupt is use by card.
  * If the interrupt is used, then gets the interrupt line from the
@@ -1635,6 +1630,11 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
        /* Wire up PHB bus resources */
        pcibios_setup_phb_resources(hose, &resources);
 
+       hose->busn.start = hose->first_busno;
+       hose->busn.end   = hose->last_busno;
+       hose->busn.flags = IORESOURCE_BUS;
+       pci_add_resource(&resources, &hose->busn);
+
        /* Create an empty bus for the toplevel */
        bus = pci_create_root_bus(hose->parent, hose->first_busno,
                                  hose->ops, hose, &resources);
@@ -1651,13 +1651,14 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
        if (node && ppc_md.pci_probe_mode)
                mode = ppc_md.pci_probe_mode(bus);
        pr_debug("    probe mode: %d\n", mode);
-       if (mode == PCI_PROBE_DEVTREE) {
-               bus->subordinate = hose->last_busno;
+       if (mode == PCI_PROBE_DEVTREE)
                of_scan_bus(node, bus);
-       }
 
-       if (mode == PCI_PROBE_NORMAL)
-               hose->last_busno = bus->subordinate = pci_scan_child_bus(bus);
+       if (mode == PCI_PROBE_NORMAL) {
+               pci_bus_update_busn_res_end(bus, 255);
+               hose->last_busno = pci_scan_child_bus(bus);
+               pci_bus_update_busn_res_end(bus, hose->last_busno);
+       }
 
        /* Platform gets a chance to do some global fixups before
         * we proceed to resource allocation