V4L/DVB (11100): au8522: fix compilation warning.
[safe/jmp/linux-2.6] / arch / x86 / pci / direct.c
index 27d61b6..bd13c3e 100644 (file)
@@ -5,7 +5,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/dmi.h>
-#include "pci.h"
+#include <asm/pci_x86.h>
 
 /*
  * Functions for accessing PCI base (first 256 bytes) and extended
@@ -173,7 +173,7 @@ static int pci_conf2_write(unsigned int seg, unsigned int bus,
 
 #undef PCI_CONF2_ADDRESS
 
-static struct pci_raw_ops pci_direct_conf2 = {
+struct pci_raw_ops pci_direct_conf2 = {
        .read =         pci_conf2_read,
        .write =        pci_conf2_write,
 };
@@ -265,14 +265,16 @@ void __init pci_direct_init(int type)
                 type);
        if (type == 1) {
                raw_pci_ops = &pci_direct_conf1;
-               if (!raw_pci_ext_ops && cpu_has_pci_ext_cfg) {
-                       printk(KERN_INFO "PCI: Using configuration type 1 "
-                              "for extended access\n");
-                       raw_pci_ext_ops = &pci_direct_conf1;
-               }
-       } else {
-               raw_pci_ops = &pci_direct_conf2;
+               if (raw_pci_ext_ops)
+                       return;
+               if (!(pci_probe & PCI_HAS_IO_ECS))
+                       return;
+               printk(KERN_INFO "PCI: Using configuration type 1 "
+                      "for extended access\n");
+               raw_pci_ext_ops = &pci_direct_conf1;
+               return;
        }
+       raw_pci_ops = &pci_direct_conf2;
 }
 
 int __init pci_direct_probe(void)
@@ -287,6 +289,7 @@ int __init pci_direct_probe(void)
 
        if (pci_check_type1()) {
                raw_pci_ops = &pci_direct_conf1;
+               port_cf9_safe = true;
                return 1;
        }
        release_resource(region);
@@ -303,6 +306,7 @@ int __init pci_direct_probe(void)
 
        if (pci_check_type2()) {
                raw_pci_ops = &pci_direct_conf2;
+               port_cf9_safe = true;
                return 2;
        }