]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
PCI: Add a generic weak pcibios_align_resource()
authorPalmer Dabbelt <palmer@dabbelt.com>
Wed, 2 Aug 2017 19:44:50 +0000 (14:44 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 2 Aug 2017 19:53:16 +0000 (14:53 -0500)
Multiple architectures define this as a trivial function, and I'm adding
another one as part of the RISC-V port.  Add a __weak version of
pcibios_align_resource() and delete the now-obselete ones in a handful of
ports.

The only functional change should be that a handful of ports used to export
pcibios_fixup_bus().  Only some architectures export this, so I just
dropped it.

Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/arc/kernel/pcibios.c
arch/arm64/kernel/pci.c
arch/ia64/pci/pci.c
arch/microblaze/pci/pci-common.c
arch/sparc/kernel/leon_pci.c
arch/sparc/kernel/pci.c
arch/sparc/kernel/pcic.c
arch/tile/kernel/pci.c
arch/tile/kernel/pci_gx.c
drivers/pci/setup-res.c

index 1c8df8fd5fed07032c33d952b2de3cce57f231af..05aba5a7b5d29659a90463c6551fa68148e3e9ae 100644 (file)
@@ -7,12 +7,3 @@
  */
 
 #include <linux/pci.h>
-
-/*
- * We don't have to worry about legacy ISA devices, so nothing to do here
- */
-resource_size_t pcibios_align_resource(void *data, const struct resource *res,
-                               resource_size_t size, resource_size_t align)
-{
-       return res->start;
-}
index d91051259bb2d9e94f4f864ed3ab4508165efa7a..0e2ea1c785427849b68435eb1c188e8b7d65eb64 100644 (file)
 #include <linux/pci-ecam.h>
 #include <linux/slab.h>
 
-/*
- * We don't have to worry about legacy ISA devices, so nothing to do here
- */
-resource_size_t pcibios_align_resource(void *data, const struct resource *res,
-                               resource_size_t size, resource_size_t align)
-{
-       return res->start;
-}
-
 #ifdef CONFIG_ACPI
 /*
  * Try to assign the IRQ number when probing a new device
index 4068bde623dc3dd40c1dc81ccc021d6fdc6303a2..f5ec736100ee6a6a036b6b5b3fa024125aa43154 100644 (file)
@@ -411,13 +411,6 @@ pcibios_disable_device (struct pci_dev *dev)
                acpi_pci_irq_disable(dev);
 }
 
-resource_size_t
-pcibios_align_resource (void *data, const struct resource *res,
-                       resource_size_t size, resource_size_t align)
-{
-       return res->start;
-}
-
 /**
  * ia64_pci_get_legacy_mem - generic legacy mem routine
  * @bus: bus to get legacy memory base address for
index 940f266e5d5ca44509d69855aed6f16594b5c535..5835c09c6e26eb368108ac0f59cea53d4bd31eb6 100644 (file)
@@ -823,13 +823,6 @@ void pcibios_setup_bus_devices(struct pci_bus *bus)
  * but we want to try to avoid allocating at 0x2900-0x2bff
  * which might have be mirrored at 0x0100-0x03ff..
  */
-resource_size_t pcibios_align_resource(void *data, const struct resource *res,
-                               resource_size_t size, resource_size_t align)
-{
-       return res->start;
-}
-EXPORT_SYMBOL(pcibios_align_resource);
-
 int pcibios_add_device(struct pci_dev *dev)
 {
        dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
index 4371f72ff02500d57c56343a254468375324490c..0eafdf3d036d57065233c695ef21f3df2bbd08fa 100644 (file)
@@ -94,9 +94,3 @@ void pcibios_fixup_bus(struct pci_bus *pbus)
                }
        }
 }
-
-resource_size_t pcibios_align_resource(void *data, const struct resource *res,
-                               resource_size_t size, resource_size_t align)
-{
-       return res->start;
-}
index 78d3dc25e126faa22ab1d57c3549e80097722c5e..3f8670c9295115d4186762f89726a9ab7f55442f 100644 (file)
@@ -690,12 +690,6 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm,
        return bus;
 }
 
-resource_size_t pcibios_align_resource(void *data, const struct resource *res,
-                               resource_size_t size, resource_size_t align)
-{
-       return res->start;
-}
-
 int pcibios_enable_device(struct pci_dev *dev, int mask)
 {
        u16 cmd, oldcmd;
index a38787b843220807d0f5527f864981fc75e8486f..e038e343f2c1e5df71f2e5cba47f822a48b6ce84 100644 (file)
@@ -746,12 +746,6 @@ static void watchdog_reset() {
 }
 #endif
 
-resource_size_t pcibios_align_resource(void *data, const struct resource *res,
-                               resource_size_t size, resource_size_t align)
-{
-       return res->start;
-}
-
 int pcibios_enable_device(struct pci_dev *pdev, int mask)
 {
        return 0;
index 3113d4d5c329e89e721872cf087ac1a54e24ad55..8999a20ed9d102780d9262be8f37881085e22065 100644 (file)
@@ -66,16 +66,6 @@ static int pci_scan_flags[TILE_NUM_PCIE];
 static struct pci_ops tile_cfg_ops;
 
 
-/*
- * We don't need to worry about the alignment of resources.
- */
-resource_size_t pcibios_align_resource(void *data, const struct resource *res,
-                           resource_size_t size, resource_size_t align)
-{
-       return res->start;
-}
-EXPORT_SYMBOL(pcibios_align_resource);
-
 /*
  * Open a FD to the hypervisor PCI device.
  *
index b89172b592cc5c0a1a98acf02a9d37fb8d27fde7..0a7642184a9a71815a02f8ecc6f33780de86a8be 100644 (file)
@@ -108,15 +108,6 @@ static struct pci_ops tile_cfg_ops;
 /* Mask of CPUs that should receive PCIe interrupts. */
 static struct cpumask intr_cpus_map;
 
-/* We don't need to worry about the alignment of resources. */
-resource_size_t pcibios_align_resource(void *data, const struct resource *res,
-                                      resource_size_t size,
-                                      resource_size_t align)
-{
-       return res->start;
-}
-EXPORT_SYMBOL(pcibios_align_resource);
-
 /*
  * Pick a CPU to receive and handle the PCIe interrupts, based on the IRQ #.
  * For now, we simply send interrupts to non-dataplane CPUs.
index 85774b7a316aac4b8b2d49f8a448d9539cb333b1..e576e1a8d9782627642ace274b456a86772732a9 100644 (file)
@@ -234,6 +234,19 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
        return 0;
 }
 
+/*
+ * We don't have to worry about legacy ISA devices, so nothing to do here.
+ * This is marked as __weak because multiple architectures define it; it should
+ * eventually go away.
+ */
+resource_size_t __weak pcibios_align_resource(void *data,
+                                             const struct resource *res,
+                                             resource_size_t size,
+                                             resource_size_t align)
+{
+       return res->start;
+}
+
 static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev,
                int resno, resource_size_t size, resource_size_t align)
 {