Commit 151d16d531c5bc60bad9dc62102be18f11b4280a

Authored by Bjorn Helgaas
1 parent dcce6dc486

alpha/PCI: replace pci_probe_only with pci_flags

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>

Showing 5 changed files with 12 additions and 13 deletions Side-by-side Diff

arch/alpha/include/asm/pci.h
... ... @@ -7,6 +7,7 @@
7 7 #include <linux/dma-mapping.h>
8 8 #include <asm/scatterlist.h>
9 9 #include <asm/machvec.h>
  10 +#include <asm-generic/pci-bridge.h>
10 11  
11 12 /*
12 13 * The following structure is used to manage multiple PCI busses.
arch/alpha/kernel/pci.c
... ... @@ -43,12 +43,10 @@
43 43  
44 44 const char pci_hae0_name[] = "HAE0";
45 45  
46   -/* Indicate whether we respect the PCI setup left by console. */
47 46 /*
48   - * Make this long-lived so that we know when shutting down
49   - * whether we probed only or not.
  47 + * If PCI_PROBE_ONLY in pci_flags is set, we don't change any PCI resource
  48 + * assignments.
50 49 */
51   -int pci_probe_only;
52 50  
53 51 /*
54 52 * The PCI controller list.
... ... @@ -215,7 +213,7 @@
215 213 struct pdev_srm_saved_conf *tmp;
216 214 static int printed = 0;
217 215  
218   - if (!alpha_using_srm || pci_probe_only)
  216 + if (!alpha_using_srm || pci_has_flag(PCI_PROBE_ONLY))
219 217 return;
220 218  
221 219 if (!printed) {
... ... @@ -242,7 +240,7 @@
242 240 struct pdev_srm_saved_conf *tmp;
243 241  
244 242 /* No need to restore if probed only. */
245   - if (pci_probe_only)
  243 + if (pci_has_flag(PCI_PROBE_ONLY))
246 244 return;
247 245  
248 246 /* Restore SRM config. */
... ... @@ -283,7 +281,7 @@
283 281 {
284 282 struct pci_dev *dev = bus->self;
285 283  
286   - if (pci_probe_only && dev &&
  284 + if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
287 285 (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
288 286 pci_read_bridge_bases(bus);
289 287 pcibios_fixup_device_resources(dev, bus);
... ... @@ -374,7 +372,8 @@
374 372  
375 373 if (r->parent || !r->start || !r->flags)
376 374 continue;
377   - if (pci_probe_only || (r->flags & IORESOURCE_PCI_FIXED))
  375 + if (pci_has_flag(PCI_PROBE_ONLY) ||
  376 + (r->flags & IORESOURCE_PCI_FIXED))
378 377 pci_claim_resource(dev, i);
379 378 }
380 379 }
arch/alpha/kernel/pci_impl.h
... ... @@ -173,9 +173,6 @@
173 173 extern struct pci_controller *hose_head, **hose_tail;
174 174 extern struct pci_controller *pci_isa_hose;
175 175  
176   -/* Indicate that we trust the console to configure things properly. */
177   -extern int pci_probe_only;
178   -
179 176 extern unsigned long alpha_agpgart_size;
180 177  
181 178 extern void common_init_pci(void);
arch/alpha/kernel/sys_marvel.c
... ... @@ -384,7 +384,8 @@
384 384  
385 385 marvel_register_error_handlers();
386 386  
387   - pci_probe_only = 1;
  387 + /* Indicate that we trust the console to configure things properly */
  388 + pci_set_flags(PCI_PROBE_ONLY);
388 389 common_init_pci();
389 390 locate_and_init_vga(NULL);
390 391  
arch/alpha/kernel/sys_titan.c
... ... @@ -331,7 +331,8 @@
331 331 */
332 332 titan_late_init();
333 333  
334   - pci_probe_only = 1;
  334 + /* Indicate that we trust the console to configure things properly */
  335 + pci_set_flags(PCI_PROBE_ONLY);
335 336 common_init_pci();
336 337 SMC669_Init(0);
337 338 locate_and_init_vga(NULL);