]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
mips/PCI: replace pci_probe_only with pci_flags
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 24 Feb 2012 03:18:57 +0000 (20:18 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 24 Feb 2012 03:18:57 +0000 (20:18 -0700)
Some architectures (alpha, mips, powerpc) have an arch-specific
"pci_probe_only" flag.  Others use PCI_PROBE_ONLY in pci_flags for
the same purpose.  This moves mips to the pci_flags approach so
generic code can use the same test across all architectures.

CC: Ralf Baechle <ralf@linux-mips.org>
CC: linux-mips@linux-mips.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/mips/include/asm/pci.h
arch/mips/pci/pci-bcm1480.c
arch/mips/pci/pci-ip27.c
arch/mips/pci/pci-lantiq.c
arch/mips/pci/pci-sb1250.c
arch/mips/pci/pci-xlr.c
arch/mips/pci/pci.c

index 576397c699208160f60e13f5aa5f95c7bd1b4bb5..1e4fa3da3f70442b9c9a663c917b3c116b58cc32 100644 (file)
@@ -92,6 +92,7 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
 #include <asm/scatterlist.h>
 #include <linux/string.h>
 #include <asm/io.h>
+#include <asm-generic/pci-bridge.h>
 
 struct pci_dev;
 
@@ -145,8 +146,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
 #define arch_setup_msi_irqs arch_setup_msi_irqs
 #endif
 
-extern int pci_probe_only;
-
 extern char * (*pcibios_plat_setup)(char *str);
 
 #endif /* _ASM_PCI_H */
index af8c319969656e9e77e7337b48b28d9f4c82b56c..37b52dc3d27e808cfad0498904a98b729755d4ed 100644 (file)
@@ -204,7 +204,7 @@ static int __init bcm1480_pcibios_init(void)
        uint64_t reg;
 
        /* CFE will assign PCI resources */
-       pci_probe_only = 1;
+       pci_set_flags(PCI_PROBE_ONLY);
 
        /* Avoid ISA compat ranges.  */
        PCIBIOS_MIN_IO = 0x00008000UL;
index 193e9494f98e060bfa66e2bcd0105685fd90f4ff..0fbe4c0c170a25f5af0bd0da083a14c47e82e5f7 100644 (file)
@@ -50,7 +50,7 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid)
        bridge_t *bridge;
        int slot;
 
-       pci_probe_only = 1;
+       pci_set_flags(PCI_PROBE_ONLY);
 
        printk("a bridge\n");
 
index be1e1afe12c3ce3aa527b4142d8f8b7aee17143e..030c77e7926e5395111913da53ef884e5ac64899 100644 (file)
@@ -270,7 +270,8 @@ static int __devinit ltq_pci_probe(struct platform_device *pdev)
 {
        struct ltq_pci_data *ltq_pci_data =
                (struct ltq_pci_data *) pdev->dev.platform_data;
-       pci_probe_only = 0;
+
+       pci_clear_flags(PCI_PROBE_ONLY);
        ltq_pci_irq_map = ltq_pci_data->irq;
        ltq_pci_membase = ioremap_nocache(PCI_CR_BASE_ADDR, PCI_CR_SIZE);
        ltq_pci_mapped_cfg =
index 1711e8e101bc8e0348bb840d2b8973cd7c73f39f..dd97f3a83baa26f0c42daddb9a70dfad278f30fd 100644 (file)
@@ -213,7 +213,7 @@ static int __init sb1250_pcibios_init(void)
        uint64_t reg;
 
        /* CFE will assign PCI resources */
-       pci_probe_only = 1;
+       pci_set_flags(PCI_PROBE_ONLY);
 
        /* Avoid ISA compat ranges.  */
        PCIBIOS_MIN_IO = 0x00008000UL;
index 3d701a962ef409928e3c149f00e6b4ad7b6739e2..1644805a6730db188bf9f26245c947551e8a4b5b 100644 (file)
@@ -292,7 +292,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
 static int __init pcibios_init(void)
 {
        /* PSB assigns PCI resources */
-       pci_probe_only = 1;
+       pci_set_flags(PCI_PROBE_ONLY);
        pci_config_base = ioremap(DEFAULT_PCI_CONFIG_BASE, 16 << 20);
 
        /* Extend IO port for memory mapped io */
index aec2b111d35b0131f805e736bd80c2ca19d59cbf..2a11045120362842075f2b0ba6cfefef149a4d81 100644 (file)
 #include <asm/cpu-info.h>
 
 /*
- * Indicate whether we respect the PCI setup left by the firmware.
- *
- * Make this long-lived  so that we know when shutting down
- * whether we probed only or not.
+ * If PCI_PROBE_ONLY in pci_flags is set, we don't change any PCI resource
+ * assignments.
  */
-int pci_probe_only;
 
 #define PCI_ASSIGN_ALL_BUSSES  1
 
@@ -92,7 +89,7 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose)
        if (!hose->iommu)
                PCI_DMA_BUS_IS_PHYS = 1;
 
-       if (hose->get_busno && pci_probe_only)
+       if (hose->get_busno && pci_has_flag(PCI_PROBE_ONLY))
                next_busno = (*hose->get_busno)();
 
        pci_add_resource(&resources, hose->mem_resource);
@@ -115,7 +112,7 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose)
                        need_domain_info = 1;
                }
 
-               if (!pci_probe_only) {
+               if (!pci_has_flag(PCI_PROBE_ONLY)) {
                        pci_bus_size_bridges(bus);
                        pci_bus_assign_resources(bus);
                        pci_enable_bridges(bus);
@@ -282,7 +279,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
        struct list_head *ln;
        struct pci_dev *dev = bus->self;
 
-       if (pci_probe_only && dev &&
+       if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
            (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
                pci_read_bridge_bases(bus);
                pcibios_fixup_device_resources(dev, bus);