From: Bjorn Helgaas <bhelgaas@google.com>
To: linux-pci@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Subject: [PATCH v2 18/18] PCI: collapse pcibios_resource_to_bus
Date: Thu, 09 Feb 2012 19:37:53 -0700 [thread overview]
Message-ID: <20120210023753.10311.97210.stgit@bhelgaas.mtv.corp.google.com> (raw)
In-Reply-To: <20120210023424.10311.82445.stgit@bhelgaas.mtv.corp.google.com>
Everybody uses the generic pcibios_resource_to_bus() supplied by the core
now, so remove the ARCH_HAS_GENERIC_PCI_OFFSETS used during conversion.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/alpha/include/asm/pci.h | 2 --
arch/arm/include/asm/pci.h | 2 --
arch/ia64/include/asm/pci.h | 2 --
arch/microblaze/include/asm/pci.h | 2 --
arch/mips/include/asm/pci.h | 2 --
arch/mn10300/include/asm/pci.h | 2 --
arch/parisc/include/asm/pci.h | 2 --
arch/powerpc/include/asm/pci.h | 2 --
arch/sh/include/asm/pci.h | 2 --
arch/sparc/include/asm/pci_32.h | 2 --
arch/sparc/include/asm/pci_64.h | 2 --
drivers/pci/probe.c | 44 +++++++++++++------------------------
include/asm-generic/pci.h | 2 --
13 files changed, 15 insertions(+), 53 deletions(-)
diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h
index dace435..b781200 100644
--- a/arch/alpha/include/asm/pci.h
+++ b/arch/alpha/include/asm/pci.h
@@ -99,8 +99,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
return channel ? 15 : 14;
}
-#define ARCH_HAS_GENERIC_PCI_OFFSETS
-
#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
static inline int pci_proc_domain(struct pci_bus *bus)
diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h
index 4748a75..a98a2e1 100644
--- a/arch/arm/include/asm/pci.h
+++ b/arch/arm/include/asm/pci.h
@@ -57,8 +57,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
enum pci_mmap_state mmap_state, int write_combine);
-#define ARCH_HAS_GENERIC_PCI_OFFSETS
-
/*
* Dummy implementation; always return 0.
*/
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
index 519bb5c..b22e5f5 100644
--- a/arch/ia64/include/asm/pci.h
+++ b/arch/ia64/include/asm/pci.h
@@ -108,8 +108,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
return (pci_domain_nr(bus) != 0);
}
-#define ARCH_HAS_GENERIC_PCI_OFFSETS
-
static inline struct resource *
pcibios_select_root(struct pci_dev *pdev, struct resource *res)
{
diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h
index 8db01f7..a0da88b 100644
--- a/arch/microblaze/include/asm/pci.h
+++ b/arch/microblaze/include/asm/pci.h
@@ -94,8 +94,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
*/
#define PCI_DMA_BUS_IS_PHYS (1)
-#define ARCH_HAS_GENERIC_PCI_OFFSETS
-
static inline struct resource *pcibios_select_root(struct pci_dev *pdev,
struct resource *res)
{
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
index 2be0c69..a573bf6 100644
--- a/arch/mips/include/asm/pci.h
+++ b/arch/mips/include/asm/pci.h
@@ -112,8 +112,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
}
#endif
-#define ARCH_HAS_GENERIC_PCI_OFFSETS
-
#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
static inline int pci_proc_domain(struct pci_bus *bus)
diff --git a/arch/mn10300/include/asm/pci.h b/arch/mn10300/include/asm/pci.h
index dfe1581..8137c25 100644
--- a/arch/mn10300/include/asm/pci.h
+++ b/arch/mn10300/include/asm/pci.h
@@ -85,8 +85,6 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
/* implement the pci_ DMA API in terms of the generic device dma_ one */
#include <asm-generic/pci-dma-compat.h>
-#define ARCH_HAS_GENERIC_PCI_OFFSETS
-
static inline struct resource *
pcibios_select_root(struct pci_dev *pdev, struct resource *res)
{
diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h
index a8b591f..3234f49 100644
--- a/arch/parisc/include/asm/pci.h
+++ b/arch/parisc/include/asm/pci.h
@@ -215,8 +215,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
}
#endif
-#define ARCH_HAS_GENERIC_PCI_OFFSETS
-
static inline void pcibios_penalize_isa_irq(int irq, int active)
{
/* We don't need to penalize isa irq's */
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
index 839178b..201e352 100644
--- a/arch/powerpc/include/asm/pci.h
+++ b/arch/powerpc/include/asm/pci.h
@@ -154,8 +154,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
#endif /* CONFIG_PPC64 */
-#define ARCH_HAS_GENERIC_PCI_OFFSETS
-
extern void pcibios_claim_one_bus(struct pci_bus *b);
extern void pcibios_finish_adding_to_bus(struct pci_bus *bus);
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
index 3b5b6ab..bff96c2 100644
--- a/arch/sh/include/asm/pci.h
+++ b/arch/sh/include/asm/pci.h
@@ -114,8 +114,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
/* Board-specific fixup routines. */
int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin);
-#define ARCH_HAS_GENERIC_PCI_OFFSETS
-
#define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index
static inline int pci_proc_domain(struct pci_bus *bus)
diff --git a/arch/sparc/include/asm/pci_32.h b/arch/sparc/include/asm/pci_32.h
index 6384f30..dc50329 100644
--- a/arch/sparc/include/asm/pci_32.h
+++ b/arch/sparc/include/asm/pci_32.h
@@ -52,8 +52,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
* 64Kbytes by the Host controller.
*/
-#define ARCH_HAS_GENERIC_PCI_OFFSETS
-
static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
{
return PCI_IRQ_NONE;
diff --git a/arch/sparc/include/asm/pci_64.h b/arch/sparc/include/asm/pci_64.h
index 2918bd1..1633b71 100644
--- a/arch/sparc/include/asm/pci_64.h
+++ b/arch/sparc/include/asm/pci_64.h
@@ -73,8 +73,6 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
enum pci_mmap_state mmap_state,
int write_combine);
-#define ARCH_HAS_GENERIC_PCI_OFFSETS
-
static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
{
return PCI_IRQ_NONE;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index f3c503a..5a74d0f 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -66,8 +66,8 @@ static bool resource_contains(struct resource *res1, struct resource *res2)
return res1->start <= res2->start && res1->end >= res2->end;
}
-void pci_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
- struct resource *res)
+void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
+ struct resource *res)
{
struct pci_host_bridge *bridge = pci_host_bridge(dev);
struct pci_host_bridge_window *window;
@@ -86,6 +86,7 @@ void pci_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
region->start = res->start - offset;
region->end = res->end - offset;
}
+EXPORT_SYMBOL(pcibios_resource_to_bus);
static bool region_contains(struct pci_bus_region *region1,
struct pci_bus_region *region2)
@@ -93,8 +94,8 @@ static bool region_contains(struct pci_bus_region *region1,
return region1->start <= region2->start && region1->end >= region2->end;
}
-void pci_bus_to_resource(struct pci_dev *dev, struct resource *res,
- struct pci_bus_region *region)
+void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
+ struct pci_bus_region *region)
{
struct pci_host_bridge *bridge = pci_host_bridge(dev);
struct pci_host_bridge_window *window;
@@ -117,22 +118,7 @@ void pci_bus_to_resource(struct pci_dev *dev, struct resource *res,
res->start = region->start + offset;
res->end = region->end + offset;
}
-
-#ifdef ARCH_HAS_GENERIC_PCI_OFFSETS
-void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
- struct resource *res)
-{
- pci_resource_to_bus(dev, region, res);
-}
-EXPORT_SYMBOL(pcibios_resource_to_bus);
-
-void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
- struct pci_bus_region *region)
-{
- pci_bus_to_resource(dev, res, region);
-}
EXPORT_SYMBOL(pcibios_bus_to_resource);
-#endif
/*
* PCI Bus Class
@@ -309,11 +295,11 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
pci_write_config_dword(dev, pos + 4, 0);
region.start = 0;
region.end = sz64;
- pci_bus_to_resource(dev, res, ®ion);
+ pcibios_bus_to_resource(dev, res, ®ion);
} else {
region.start = l64;
region.end = l64 + sz64;
- pci_bus_to_resource(dev, res, ®ion);
+ pcibios_bus_to_resource(dev, res, ®ion);
dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n",
pos, res);
}
@@ -325,7 +311,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
region.start = l;
region.end = l + sz;
- pci_bus_to_resource(dev, res, ®ion);
+ pcibios_bus_to_resource(dev, res, ®ion);
dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res);
}
@@ -383,7 +369,7 @@ static void __devinit pci_read_bridge_io(struct pci_bus *child)
res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO;
region.start = base;
region.end = limit + 0xfff;
- pci_bus_to_resource(dev, &res2, ®ion);
+ pcibios_bus_to_resource(dev, &res2, ®ion);
if (!res->start)
res->start = res2.start;
if (!res->end)
@@ -409,7 +395,7 @@ static void __devinit pci_read_bridge_mmio(struct pci_bus *child)
res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
region.start = base;
region.end = limit + 0xfffff;
- pci_bus_to_resource(dev, res, ®ion);
+ pcibios_bus_to_resource(dev, res, ®ion);
dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res);
}
}
@@ -458,7 +444,7 @@ static void __devinit pci_read_bridge_mmio_pref(struct pci_bus *child)
res->flags |= IORESOURCE_MEM_64;
region.start = base;
region.end = limit + 0xfffff;
- pci_bus_to_resource(dev, res, ®ion);
+ pcibios_bus_to_resource(dev, res, ®ion);
dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res);
}
}
@@ -1068,24 +1054,24 @@ int pci_setup_device(struct pci_dev *dev)
region.end = 0x1F7;
res = &dev->resource[0];
res->flags = LEGACY_IO_RESOURCE;
- pci_bus_to_resource(dev, res, ®ion);
+ pcibios_bus_to_resource(dev, res, ®ion);
region.start = 0x3F6;
region.end = 0x3F6;
res = &dev->resource[1];
res->flags = LEGACY_IO_RESOURCE;
- pci_bus_to_resource(dev, res, ®ion);
+ pcibios_bus_to_resource(dev, res, ®ion);
}
if ((progif & 4) == 0) {
region.start = 0x170;
region.end = 0x177;
res = &dev->resource[2];
res->flags = LEGACY_IO_RESOURCE;
- pci_bus_to_resource(dev, res, ®ion);
+ pcibios_bus_to_resource(dev, res, ®ion);
region.start = 0x376;
region.end = 0x376;
res = &dev->resource[3];
res->flags = LEGACY_IO_RESOURCE;
- pci_bus_to_resource(dev, res, ®ion);
+ pcibios_bus_to_resource(dev, res, ®ion);
}
}
break;
diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h
index 0410346..e80a049 100644
--- a/include/asm-generic/pci.h
+++ b/include/asm-generic/pci.h
@@ -6,8 +6,6 @@
#ifndef _ASM_GENERIC_PCI_H
#define _ASM_GENERIC_PCI_H
-#define ARCH_HAS_GENERIC_PCI_OFFSETS
-
static inline struct resource *
pcibios_select_root(struct pci_dev *pdev, struct resource *res)
{
next prev parent reply other threads:[~2012-02-10 2:37 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-10 2:36 [PATCH v2 00/18] add PCI bus-to-resource offset support in core Bjorn Helgaas
2012-02-10 2:36 ` [PATCH v2 01/18] PCI: don't publish new root bus until it's fully initialized Bjorn Helgaas
2012-02-10 2:36 ` [PATCH v2 02/18] PCI: add struct pci_host_bridge and a list of all bridges found Bjorn Helgaas
2012-02-10 3:47 ` Yinghai Lu
2012-02-10 4:16 ` Bjorn Helgaas
2012-02-10 2:36 ` [PATCH v2 03/18] PCI: add struct pci_host_bridge_window with CPU/bus address offset Bjorn Helgaas
2012-02-10 3:49 ` Yinghai Lu
2012-02-10 4:37 ` Bjorn Helgaas
2012-02-10 2:36 ` [PATCH v2 04/18] PCI: convert bus addresses to resource when reading BARs Bjorn Helgaas
2012-02-10 2:36 ` [PATCH v2 05/18] PCI: add generic pcibios_resource_to_bus() Bjorn Helgaas
2012-02-10 2:36 ` [PATCH v2 06/18] alpha/PCI: get rid of device resource fixups Bjorn Helgaas
2012-02-10 2:36 ` [PATCH v2 07/18] arm/PCI: " Bjorn Helgaas
2012-02-10 2:37 ` [PATCH v2 08/18] ia64/PCI: SN: convert to pci_scan_root_bus() for correct root bus resources Bjorn Helgaas
2012-02-10 2:46 ` Bjorn Helgaas
2012-02-10 2:37 ` [PATCH v2 09/18] ia64/PCI: get rid of device resource fixups Bjorn Helgaas
2012-02-10 2:37 ` [PATCH v2 10/18] microblaze/PCI: " Bjorn Helgaas
2012-02-10 2:37 ` [PATCH v2 11/18] mips/PCI: " Bjorn Helgaas
2012-02-10 2:43 ` Bjorn Helgaas
2012-02-10 2:37 ` [PATCH v2 12/18] mn10300/PCI: " Bjorn Helgaas
2012-02-10 2:37 ` [PATCH v2 13/18] parisc/PCI: " Bjorn Helgaas
2012-02-10 2:37 ` [PATCH v2 14/18] powerpc/PCI: " Bjorn Helgaas
2012-02-10 2:37 ` [PATCH v2 15/18] sh/PCI: " Bjorn Helgaas
2012-02-10 2:37 ` [PATCH v2 16/18] sparc/PCI: " Bjorn Helgaas
2012-02-10 2:37 ` [PATCH v2 17/18] xtensa/PCI: " Bjorn Helgaas
2012-02-10 2:37 ` Bjorn Helgaas [this message]
2012-02-10 4:03 ` [PATCH v2 00/18] add PCI bus-to-resource offset support in core Yinghai Lu
2012-02-10 4:34 ` Bjorn Helgaas
2012-02-10 4:50 ` Yinghai Lu
2012-02-10 16:55 ` Bjorn Helgaas
2012-02-10 17:20 ` Yinghai Lu
2012-02-10 17:24 ` Bjorn Helgaas
2012-02-10 20:25 ` Yinghai Lu
2012-02-10 22:37 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120210023753.10311.97210.stgit@bhelgaas.mtv.corp.google.com \
--to=bhelgaas@google.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).