[PATCH v2 32/37] x86, PCI: add __pcibios_scan_specific_bus that can skip bus_add

From: Yinghai Lu
Date: Sat Mar 10 2012 - 02:03:53 EST


So could insert pci_assign_unassigned_bus_resources() before do bus_add.

Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx>
---
arch/x86/pci/legacy.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c
index a1df191..aab0e41 100644
--- a/arch/x86/pci/legacy.c
+++ b/arch/x86/pci/legacy.c
@@ -34,25 +34,32 @@ int __init pci_legacy_init(void)
return 0;
}

-void __devinit pcibios_scan_specific_bus(int busn)
+static __devinit struct pci_bus *__pcibios_scan_specific_bus(int busn,
+ bool bus_add)
{
int devfn;
long node;
u32 l;

- if (pci_find_bus(0, busn))
- return;
-
node = get_mp_bus_to_node(busn);
for (devfn = 0; devfn < 256; devfn += 8) {
if (!raw_pci_read(0, busn, devfn, PCI_VENDOR_ID, 2, &l) &&
l != 0x0000 && l != 0xffff) {
DBG("Found device at %02x:%02x [%04x]\n", busn, devfn, l);
printk(KERN_INFO "PCI: Discovered peer bus %02x\n", busn);
- pci_scan_bus_on_node(busn, &pci_root_ops, node);
- return;
+ return __pci_scan_bus_on_node(busn, &pci_root_ops, node,
+ bus_add);
}
}
+
+ return NULL;
+}
+void __devinit pcibios_scan_specific_bus(int busn)
+{
+ if (pci_find_bus(0, busn))
+ return;
+
+ __pcibios_scan_specific_bus(busn, true);
}
EXPORT_SYMBOL_GPL(pcibios_scan_specific_bus);

--
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/