aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-16 20:33:41 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-16 20:33:41 +0200
commitc1da678b5b4d8ce7836ed1ded80109d1db37efe0 (patch)
tree8f8f0421b487cc91a58186e78fec45a9512fc224
parent01397012b3129147890bb116431d5a794dfc3990 (diff)
downloadkernel_samsung_smdk4412-c1da678b5b4d8ce7836ed1ded80109d1db37efe0.zip
kernel_samsung_smdk4412-c1da678b5b4d8ce7836ed1ded80109d1db37efe0.tar.gz
kernel_samsung_smdk4412-c1da678b5b4d8ce7836ed1ded80109d1db37efe0.tar.bz2
ide: tighten checks on PCI BARs in ide_hwif_configure()
Alan has fixed PCI layer handling of PCI IDE in Compatibility mode so PCI BAR 0/1 (and/or 2/3) content reported by kernel should never be zero. Tighten checks on PCI BARs and also fix printk() message while on it. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/setup-pci.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 3dea5a5..166211f 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -319,18 +319,18 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev,
ctl = pci_resource_start(dev, 2*port+1);
base = pci_resource_start(dev, 2*port);
- if ((ctl && !base) || (base && !ctl)) {
- printk(KERN_ERR "%s: inconsistent baseregs (BIOS) "
- "for port %d, skipping\n", d->name, port);
- return NULL;
- }
- }
- if (!ctl) {
+ } else {
/* Use default values */
ctl = port ? 0x374 : 0x3f4;
base = port ? 0x170 : 0x1f0;
}
+ if (!base || !ctl) {
+ printk(KERN_ERR "%s: bad PCI BARs for port %d, skipping\n",
+ d->name, port);
+ return NULL;
+ }
+
hwif = ide_find_port_slot(d);
if (hwif == NULL) {
printk(KERN_ERR "%s: too many IDE interfaces, no room in "