]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
alpha/PCI: replace pci_probe_only with pci_flags
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 24 Feb 2012 03:18:56 +0000 (20:18 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 24 Feb 2012 03:18:56 +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 alpha to the pci_flags approach so
generic code can use the same test across all architectures.

CC: linux-alpha@vger.kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/alpha/include/asm/pci.h
arch/alpha/kernel/pci.c
arch/alpha/kernel/pci_impl.h
arch/alpha/kernel/sys_marvel.c
arch/alpha/kernel/sys_titan.c

index 28d0497fd3c7b6b95b48571fff3f6028534de145..6a3fe0704620ad1173c619eaf5a4bd5aea1f9e7a 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/dma-mapping.h>
 #include <asm/scatterlist.h>
 #include <asm/machvec.h>
+#include <asm-generic/pci-bridge.h>
 
 /*
  * The following structure is used to manage multiple PCI busses.
index 8c723c1b086a03fd26ca69beabd794da836cc41b..3a5cdf2a8fd092289605a15fa76bfdd3c5315b89 100644 (file)
@@ -43,12 +43,10 @@ const char *const pci_mem_names[] = {
 
 const char pci_hae0_name[] = "HAE0";
 
-/* Indicate whether we respect the PCI setup left by console. */
 /*
- * 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;
 
 /*
  * The PCI controller list.
@@ -215,7 +213,7 @@ pdev_save_srm_config(struct pci_dev *dev)
        struct pdev_srm_saved_conf *tmp;
        static int printed = 0;
 
-       if (!alpha_using_srm || pci_probe_only)
+       if (!alpha_using_srm || pci_has_flag(PCI_PROBE_ONLY))
                return;
 
        if (!printed) {
@@ -242,7 +240,7 @@ pci_restore_srm_config(void)
        struct pdev_srm_saved_conf *tmp;
 
        /* No need to restore if probed only. */
-       if (pci_probe_only)
+       if (pci_has_flag(PCI_PROBE_ONLY))
                return;
 
        /* Restore SRM config. */
@@ -283,7 +281,7 @@ pcibios_fixup_bus(struct pci_bus *bus)
 {
        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);
@@ -374,7 +372,8 @@ pcibios_claim_one_bus(struct pci_bus *b)
 
                        if (r->parent || !r->start || !r->flags)
                                continue;
-                       if (pci_probe_only || (r->flags & IORESOURCE_PCI_FIXED))
+                       if (pci_has_flag(PCI_PROBE_ONLY) ||
+                           (r->flags & IORESOURCE_PCI_FIXED))
                                pci_claim_resource(dev, i);
                }
        }
index 85457b2d4516dc009ad0407c6b01731add69081b..2b0ac429f5ebc4912e34b41029810fa914124479 100644 (file)
@@ -173,9 +173,6 @@ extern void pci_restore_srm_config(void);
 extern struct pci_controller *hose_head, **hose_tail;
 extern struct pci_controller *pci_isa_hose;
 
-/* Indicate that we trust the console to configure things properly.  */
-extern int pci_probe_only;
-
 extern unsigned long alpha_agpgart_size;
 
 extern void common_init_pci(void);
index 95cfc83ece8f7e771fc62f6567d1a2d0f948fffc..fc8b125086115f7bd2e66e210dfb24753d5d2f13 100644 (file)
@@ -384,7 +384,8 @@ marvel_init_pci(void)
 
        marvel_register_error_handlers();
 
-       pci_probe_only = 1;
+       /* Indicate that we trust the console to configure things properly */
+       pci_set_flags(PCI_PROBE_ONLY);
        common_init_pci();
        locate_and_init_vga(NULL);
 
index f47b30a2a117036db3cd877db99fcc72ca26203d..b8eafa053539005d7ddd0bffb4ee293cd5910891 100644 (file)
@@ -331,7 +331,8 @@ titan_init_pci(void)
         */
        titan_late_init();
  
-       pci_probe_only = 1;
+       /* Indicate that we trust the console to configure things properly */
+       pci_set_flags(PCI_PROBE_ONLY);
        common_init_pci();
        SMC669_Init(0);
        locate_and_init_vga(NULL);