Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: remove pcibios_scan_all_fns()

This was #define'd as 0 on all platforms, so let's get rid of it.

This change makes pci_scan_slot() slightly easier to read.

Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Tony Luck <tony.luck@intel.com>
Cc: David Howells <dhowells@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Acked-by: Russell King <linux@arm.linux.org.uk>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

authored by

Alex Chiang and committed by
Jesse Barnes
a7db5040 7135a71b

+37 -19
-1
arch/alpha/include/asm/pci.h
··· 52 52 bus numbers. */ 53 53 54 54 #define pcibios_assign_all_busses() 1 55 - #define pcibios_scan_all_fns(a, b) 0 56 55 57 56 #define PCIBIOS_MIN_IO alpha_mv.min_io_address 58 57 #define PCIBIOS_MIN_MEM alpha_mv.min_mem_address
-2
arch/arm/include/asm/pci.h
··· 6 6 7 7 #include <mach/hardware.h> /* for PCIBIOS_MIN_* */ 8 8 9 - #define pcibios_scan_all_fns(a, b) 0 10 - 11 9 #ifdef CONFIG_PCI_HOST_ITE8152 12 10 /* ITE bridge requires setting latency timer to avoid early bus access 13 11 termination by PIC bus mater devices
-1
arch/h8300/include/asm/pci.h
··· 8 8 */ 9 9 10 10 #define pcibios_assign_all_busses() 0 11 - #define pcibios_scan_all_fns(a, b) 0 12 11 13 12 static inline void pcibios_set_master(struct pci_dev *dev) 14 13 {
+12 -2
arch/ia64/include/asm/pci.h
··· 17 17 * loader. 18 18 */ 19 19 #define pcibios_assign_all_busses() 0 20 - #define pcibios_scan_all_fns(a, b) 0 21 20 22 21 #define PCIBIOS_MIN_IO 0x1000 23 22 #define PCIBIOS_MIN_MEM 0x10000000 ··· 134 135 extern void pcibios_bus_to_resource(struct pci_dev *dev, 135 136 struct resource *res, struct pci_bus_region *region); 136 137 137 - #define pcibios_scan_all_fns(a, b) 0 138 + static inline struct resource * 139 + pcibios_select_root(struct pci_dev *pdev, struct resource *res) 140 + { 141 + struct resource *root = NULL; 142 + 143 + if (res->flags & IORESOURCE_IO) 144 + root = &ioport_resource; 145 + if (res->flags & IORESOURCE_MEM) 146 + root = &iomem_resource; 147 + 148 + return root; 149 + } 138 150 139 151 #define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ 140 152 static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
-2
arch/mips/include/asm/pci.h
··· 65 65 66 66 extern unsigned int pcibios_assign_all_busses(void); 67 67 68 - #define pcibios_scan_all_fns(a, b) 0 69 - 70 68 extern unsigned long PCIBIOS_MIN_IO; 71 69 extern unsigned long PCIBIOS_MIN_MEM; 72 70
+12 -1
arch/mn10300/include/asm/pci.h
··· 101 101 struct resource *res, 102 102 struct pci_bus_region *region); 103 103 104 - #define pcibios_scan_all_fns(a, b) 0 104 + static inline struct resource * 105 + pcibios_select_root(struct pci_dev *pdev, struct resource *res) 106 + { 107 + struct resource *root = NULL; 108 + 109 + if (res->flags & IORESOURCE_IO) 110 + root = &ioport_resource; 111 + if (res->flags & IORESOURCE_MEM) 112 + root = &iomem_resource; 113 + 114 + return root; 115 + } 105 116 106 117 static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 107 118 {
-1
arch/parisc/include/asm/pci.h
··· 233 233 * rp7420/8420 boxes and then revisit this issue. 234 234 */ 235 235 #define pcibios_assign_all_busses() (1) 236 - #define pcibios_scan_all_fns(a, b) (0) 237 236 238 237 #define PCIBIOS_MIN_IO 0x10 239 238 #define PCIBIOS_MIN_MEM 0x1000 /* NBPG - but pci/setup-res.c dies */
-1
arch/powerpc/include/asm/pci.h
··· 40 40 */ 41 41 #define pcibios_assign_all_busses() \ 42 42 (ppc_pci_has_flag(PPC_PCI_REASSIGN_ALL_BUS)) 43 - #define pcibios_scan_all_fns(a, b) 0 44 43 45 44 static inline void pcibios_set_master(struct pci_dev *dev) 46 45 {
-1
arch/sh/include/asm/pci.h
··· 10 10 or architectures with incomplete PCI setup by the loader */ 11 11 12 12 #define pcibios_assign_all_busses() 1 13 - #define pcibios_scan_all_fns(a, b) 0 14 13 15 14 /* 16 15 * A board can define one or more PCI channels that represent built-in (or
-1
arch/sparc/include/asm/pci_32.h
··· 10 10 * or architectures with incomplete PCI setup by the loader. 11 11 */ 12 12 #define pcibios_assign_all_busses() 0 13 - #define pcibios_scan_all_fns(a, b) 0 14 13 15 14 #define PCIBIOS_MIN_IO 0UL 16 15 #define PCIBIOS_MIN_MEM 0UL
-1
arch/sparc/include/asm/pci_64.h
··· 10 10 * or architectures with incomplete PCI setup by the loader. 11 11 */ 12 12 #define pcibios_assign_all_busses() 0 13 - #define pcibios_scan_all_fns(a, b) 0 14 13 15 14 #define PCIBIOS_MIN_IO 0UL 16 15 #define PCIBIOS_MIN_MEM 0UL
-1
arch/um/include/asm/pci.h
··· 2 2 #define __UM_PCI_H 3 3 4 4 #define PCI_DMA_BUS_IS_PHYS (1) 5 - #define pcibios_scan_all_fns(a, b) 0 6 5 7 6 #endif
-1
arch/x86/include/asm/pci.h
··· 48 48 #else 49 49 #define pcibios_assign_all_busses() 0 50 50 #endif 51 - #define pcibios_scan_all_fns(a, b) 0 52 51 53 52 extern unsigned long pci_mem_start; 54 53 #define PCIBIOS_MIN_IO 0x1000
+1 -2
drivers/pci/probe.c
··· 1061 1061 if (dev && !dev->is_added) /* new device? */ 1062 1062 nr++; 1063 1063 1064 - if ((dev && dev->multifunction) || 1065 - (!dev && pcibios_scan_all_fns(bus, devfn))) { 1064 + if (dev && dev->multifunction) { 1066 1065 for (fn = 1; fn < 8; fn++) { 1067 1066 dev = pci_scan_single_device(bus, devfn + fn); 1068 1067 if (dev) {
+12 -1
include/asm-generic/pci.h
··· 30 30 res->end = region->end; 31 31 } 32 32 33 - #define pcibios_scan_all_fns(a, b) 0 33 + static inline struct resource * 34 + pcibios_select_root(struct pci_dev *pdev, struct resource *res) 35 + { 36 + struct resource *root = NULL; 37 + 38 + if (res->flags & IORESOURCE_IO) 39 + root = &ioport_resource; 40 + if (res->flags & IORESOURCE_MEM) 41 + root = &iomem_resource; 42 + 43 + return root; 44 + } 34 45 35 46 #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ 36 47 static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)