Skip to content

Commit

Permalink
PCI: remove pcibios_scan_all_fns()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alex Chiang authored and Jesse Barnes committed Sep 9, 2009
1 parent 7135a71 commit a7db504
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 19 deletions.
1 change: 0 additions & 1 deletion arch/alpha/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ struct pci_controller {
bus numbers. */

#define pcibios_assign_all_busses() 1
#define pcibios_scan_all_fns(a, b) 0

#define PCIBIOS_MIN_IO alpha_mv.min_io_address
#define PCIBIOS_MIN_MEM alpha_mv.min_mem_address
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include <mach/hardware.h> /* for PCIBIOS_MIN_* */

#define pcibios_scan_all_fns(a, b) 0

#ifdef CONFIG_PCI_HOST_ITE8152
/* ITE bridge requires setting latency timer to avoid early bus access
termination by PIC bus mater devices
Expand Down
1 change: 0 additions & 1 deletion arch/h8300/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

#define pcibios_assign_all_busses() 0
#define pcibios_scan_all_fns(a, b) 0

static inline void pcibios_set_master(struct pci_dev *dev)
{
Expand Down
14 changes: 12 additions & 2 deletions arch/ia64/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* loader.
*/
#define pcibios_assign_all_busses() 0
#define pcibios_scan_all_fns(a, b) 0

#define PCIBIOS_MIN_IO 0x1000
#define PCIBIOS_MIN_MEM 0x10000000
Expand Down Expand Up @@ -135,7 +134,18 @@ extern void pcibios_resource_to_bus(struct pci_dev *dev,
extern void pcibios_bus_to_resource(struct pci_dev *dev,
struct resource *res, struct pci_bus_region *region);

#define pcibios_scan_all_fns(a, b) 0
static inline struct resource *
pcibios_select_root(struct pci_dev *pdev, struct resource *res)
{
struct resource *root = NULL;

if (res->flags & IORESOURCE_IO)
root = &ioport_resource;
if (res->flags & IORESOURCE_MEM)
root = &iomem_resource;

return root;
}

#define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
Expand Down
2 changes: 0 additions & 2 deletions arch/mips/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ extern int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);

extern unsigned int pcibios_assign_all_busses(void);

#define pcibios_scan_all_fns(a, b) 0

extern unsigned long PCIBIOS_MIN_IO;
extern unsigned long PCIBIOS_MIN_MEM;

Expand Down
13 changes: 12 additions & 1 deletion arch/mn10300/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,18 @@ extern void pcibios_bus_to_resource(struct pci_dev *dev,
struct resource *res,
struct pci_bus_region *region);

#define pcibios_scan_all_fns(a, b) 0
static inline struct resource *
pcibios_select_root(struct pci_dev *pdev, struct resource *res)
{
struct resource *root = NULL;

if (res->flags & IORESOURCE_IO)
root = &ioport_resource;
if (res->flags & IORESOURCE_MEM)
root = &iomem_resource;

return root;
}

static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
{
Expand Down
1 change: 0 additions & 1 deletion arch/parisc/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ static inline void pcibios_register_hba(struct pci_hba_data *x)
* rp7420/8420 boxes and then revisit this issue.
*/
#define pcibios_assign_all_busses() (1)
#define pcibios_scan_all_fns(a, b) (0)

#define PCIBIOS_MIN_IO 0x10
#define PCIBIOS_MIN_MEM 0x1000 /* NBPG - but pci/setup-res.c dies */
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ struct pci_dev;
*/
#define pcibios_assign_all_busses() \
(ppc_pci_has_flag(PPC_PCI_REASSIGN_ALL_BUS))
#define pcibios_scan_all_fns(a, b) 0

static inline void pcibios_set_master(struct pci_dev *dev)
{
Expand Down
1 change: 0 additions & 1 deletion arch/sh/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
or architectures with incomplete PCI setup by the loader */

#define pcibios_assign_all_busses() 1
#define pcibios_scan_all_fns(a, b) 0

/*
* A board can define one or more PCI channels that represent built-in (or
Expand Down
1 change: 0 additions & 1 deletion arch/sparc/include/asm/pci_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* or architectures with incomplete PCI setup by the loader.
*/
#define pcibios_assign_all_busses() 0
#define pcibios_scan_all_fns(a, b) 0

#define PCIBIOS_MIN_IO 0UL
#define PCIBIOS_MIN_MEM 0UL
Expand Down
1 change: 0 additions & 1 deletion arch/sparc/include/asm/pci_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* or architectures with incomplete PCI setup by the loader.
*/
#define pcibios_assign_all_busses() 0
#define pcibios_scan_all_fns(a, b) 0

#define PCIBIOS_MIN_IO 0UL
#define PCIBIOS_MIN_MEM 0UL
Expand Down
1 change: 0 additions & 1 deletion arch/um/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
#define __UM_PCI_H

#define PCI_DMA_BUS_IS_PHYS (1)
#define pcibios_scan_all_fns(a, b) 0

#endif
1 change: 0 additions & 1 deletion arch/x86/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ extern unsigned int pcibios_assign_all_busses(void);
#else
#define pcibios_assign_all_busses() 0
#endif
#define pcibios_scan_all_fns(a, b) 0

extern unsigned long pci_mem_start;
#define PCIBIOS_MIN_IO 0x1000
Expand Down
3 changes: 1 addition & 2 deletions drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,8 +1061,7 @@ int pci_scan_slot(struct pci_bus *bus, int devfn)
if (dev && !dev->is_added) /* new device? */
nr++;

if ((dev && dev->multifunction) ||
(!dev && pcibios_scan_all_fns(bus, devfn))) {
if (dev && dev->multifunction) {
for (fn = 1; fn < 8; fn++) {
dev = pci_scan_single_device(bus, devfn + fn);
if (dev) {
Expand Down
13 changes: 12 additions & 1 deletion include/asm-generic/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,18 @@ pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
res->end = region->end;
}

#define pcibios_scan_all_fns(a, b) 0
static inline struct resource *
pcibios_select_root(struct pci_dev *pdev, struct resource *res)
{
struct resource *root = NULL;

if (res->flags & IORESOURCE_IO)
root = &ioport_resource;
if (res->flags & IORESOURCE_MEM)
root = &iomem_resource;

return root;
}

#ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
Expand Down

0 comments on commit a7db504

Please sign in to comment.