diff options
Diffstat (limited to 'arch/i386/pci/direct.c')
-rw-r--r-- | arch/i386/pci/direct.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c index 99012b93bd12..5d81fb510375 100644 --- a/arch/i386/pci/direct.c +++ b/arch/i386/pci/direct.c | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | #include <linux/pci.h> | 5 | #include <linux/pci.h> |
6 | #include <linux/init.h> | 6 | #include <linux/init.h> |
7 | #include <linux/dmi.h> | ||
7 | #include "pci.h" | 8 | #include "pci.h" |
8 | 9 | ||
9 | /* | 10 | /* |
@@ -18,8 +19,10 @@ int pci_conf1_read(unsigned int seg, unsigned int bus, | |||
18 | { | 19 | { |
19 | unsigned long flags; | 20 | unsigned long flags; |
20 | 21 | ||
21 | if (!value || (bus > 255) || (devfn > 255) || (reg > 255)) | 22 | if ((bus > 255) || (devfn > 255) || (reg > 255)) { |
23 | *value = -1; | ||
22 | return -EINVAL; | 24 | return -EINVAL; |
25 | } | ||
23 | 26 | ||
24 | spin_lock_irqsave(&pci_config_lock, flags); | 27 | spin_lock_irqsave(&pci_config_lock, flags); |
25 | 28 | ||
@@ -91,8 +94,10 @@ static int pci_conf2_read(unsigned int seg, unsigned int bus, | |||
91 | unsigned long flags; | 94 | unsigned long flags; |
92 | int dev, fn; | 95 | int dev, fn; |
93 | 96 | ||
94 | if (!value || (bus > 255) || (devfn > 255) || (reg > 255)) | 97 | if ((bus > 255) || (devfn > 255) || (reg > 255)) { |
98 | *value = -1; | ||
95 | return -EINVAL; | 99 | return -EINVAL; |
100 | } | ||
96 | 101 | ||
97 | dev = PCI_SLOT(devfn); | 102 | dev = PCI_SLOT(devfn); |
98 | fn = PCI_FUNC(devfn); | 103 | fn = PCI_FUNC(devfn); |
@@ -188,6 +193,10 @@ static int __init pci_sanity_check(struct pci_raw_ops *o) | |||
188 | 193 | ||
189 | if (pci_probe & PCI_NO_CHECKS) | 194 | if (pci_probe & PCI_NO_CHECKS) |
190 | return 1; | 195 | return 1; |
196 | /* Assume Type 1 works for newer systems. | ||
197 | This handles machines that don't have anything on PCI Bus 0. */ | ||
198 | if (dmi_get_year(DMI_BIOS_DATE) >= 2001) | ||
199 | return 1; | ||
191 | 200 | ||
192 | for (devfn = 0; devfn < 0x100; devfn++) { | 201 | for (devfn = 0; devfn < 0x100; devfn++) { |
193 | if (o->read(0, 0, devfn, PCI_CLASS_DEVICE, 2, &x)) | 202 | if (o->read(0, 0, devfn, PCI_CLASS_DEVICE, 2, &x)) |