[PATCH 2/2] x86/pci: x86_pci_root_bus_res_quirks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Impact: fix link and clean up

1. change the name to x86_pci_root_bus_res_quirks from
	 set_pci_bus_resources_arch_default
2. move that weak function from common.c to i386.c aka
	 can not put that in same function with calling function
3. before calling that check if it is root bus in pcibios_fixup_bus

Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx>

---
 arch/x86/include/asm/topology.h |    2 +-
 arch/x86/pci/amd_bus.c          |    2 +-
 arch/x86/pci/common.c           |    8 +++-----
 arch/x86/pci/i386.c             |    4 ++++
 4 files changed, 9 insertions(+), 7 deletions(-)

Index: linux-2.6/arch/x86/include/asm/topology.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/topology.h
+++ linux-2.6/arch/x86/include/asm/topology.h
@@ -200,7 +200,7 @@ static inline void arch_fix_phys_package
 }
 
 struct pci_bus;
-void set_pci_bus_resources_arch_default(struct pci_bus *b);
+void x86_pci_root_bus_res_quirks(struct pci_bus *b);
 
 #ifdef CONFIG_SMP
 #define mc_capable()	(cpumask_weight(cpu_core_mask(0)) != nr_cpu_ids)
Index: linux-2.6/arch/x86/pci/amd_bus.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/amd_bus.c
+++ linux-2.6/arch/x86/pci/amd_bus.c
@@ -94,7 +94,7 @@ struct pci_root_info {
 static int pci_root_num;
 static struct pci_root_info pci_root_info[PCI_ROOT_NR];
 
-void set_pci_bus_resources_arch_default(struct pci_bus *b)
+void x86_pci_root_bus_res_quirks(struct pci_bus *b)
 {
 	int i;
 	int j;
Index: linux-2.6/arch/x86/pci/common.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/common.c
+++ linux-2.6/arch/x86/pci/common.c
@@ -142,10 +142,6 @@ static void __devinit pcibios_fixup_devi
 	}
 }
 
-void __attribute__((weak)) set_pci_bus_resources_arch_default(struct pci_bus *b)
-{
-}
-
 /*
  *  Called after each bus is probed, but before its children
  *  are examined.
@@ -155,7 +151,9 @@ void __devinit pcibios_fixup_bus(struct
 {
 	struct pci_dev *dev;
 
-	set_pci_bus_resources_arch_default(b);
+	/* root bus? */
+	if (!b->parent)
+		x86_pci_root_bus_res_quirks(b);
 	pci_read_bridge_bases(b);
 	list_for_each_entry(dev, &b->devices, bus_list)
 		pcibios_fixup_device_resources(dev);
Index: linux-2.6/arch/x86/pci/i386.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/i386.c
+++ linux-2.6/arch/x86/pci/i386.c
@@ -238,6 +238,10 @@ void __init pcibios_resource_survey(void
  */
 fs_initcall(pcibios_assign_resources);
 
+void __weak x86_pci_root_bus_res_quirks(struct pci_bus *b)
+{
+}
+
 /*
  *  If we set up a device for bus mastering, we need to check the latency
  *  timer as certain crappy BIOSes forget to set it properly.
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux