summaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_qdi.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2007-03-02 15:56:35 +0100
committerJeff Garzik <jeff@garzik.org>2007-03-03 00:18:38 +0100
commitcc7c15ec167767b440c1de4dbd2200467b7a493b (patch)
tree19fcd6f5a77d3c1f87ed8faf215fb4af50827d6c /drivers/ata/pata_qdi.c
parent[libata] pata_cmd64x: fix driver description in comments (diff)
downloadlinux-cc7c15ec167767b440c1de4dbd2200467b7a493b.tar.xz
linux-cc7c15ec167767b440c1de4dbd2200467b7a493b.zip
pata_qdi: Fix initialisation
The QDI init code contains some bugs which mean it only works if you have a test setup that causes both a successful and failed probe. Fix this Found by Philip Guo (Who found it working on code analysis tools not running VLB IDE controllers) Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_qdi.c')
-rw-r--r--drivers/ata/pata_qdi.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/ata/pata_qdi.c b/drivers/ata/pata_qdi.c
index c2f87da60336..c3810012f3f4 100644
--- a/drivers/ata/pata_qdi.c
+++ b/drivers/ata/pata_qdi.c
@@ -363,7 +363,8 @@ static __init int qdi_init(void)
release_region(port, 2);
continue;
}
- ct += qdi_init_one(port, 6500, ide_port[r & 0x01], ide_irq[r & 0x01], r & 0x04);
+ if (qdi_init_one(port, 6500, ide_port[r & 0x01], ide_irq[r & 0x01], r & 0x04) == 0)
+ ct++;
}
if (((r & 0xF0) == 0xA0) || (r & 0xF0) == 0x50) {
/* QD6580: dual channel */
@@ -375,11 +376,14 @@ static __init int qdi_init(void)
res = inb(port + 3);
if (res & 1) {
/* Single channel mode */
- ct += qdi_init_one(port, 6580, ide_port[r & 0x01], ide_irq[r & 0x01], r & 0x04);
+ if (qdi_init_one(port, 6580, ide_port[r & 0x01], ide_irq[r & 0x01], r & 0x04))
+ ct++;
} else {
/* Dual channel mode */
- ct += qdi_init_one(port, 6580, 0x1F0, 14, r & 0x04);
- ct += qdi_init_one(port + 2, 6580, 0x170, 15, r & 0x04);
+ if (qdi_init_one(port, 6580, 0x1F0, 14, r & 0x04) == 0)
+ ct++;
+ if (qdi_init_one(port + 2, 6580, 0x170, 15, r & 0x04) == 0)
+ ct++;
}
}
}