summaryrefslogtreecommitdiff
path: root/drivers/ata/pata_legacy.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-12-03 22:32:11 +0300
committerJeff Garzik <jgarzik@redhat.com>2009-12-04 00:06:14 +0300
commit6809e7301fba4f9fa446ead5167faed115690fc4 (patch)
tree473bbf46a8c92a31f44162fa7cf66f64545809b7 /drivers/ata/pata_legacy.c
parent43c7d17ee7e03433c57dc4ce457d34110108455a (diff)
downloadlinux-6809e7301fba4f9fa446ead5167faed115690fc4.tar.xz
pata_legacy: fix access to control register for QDI6580
We need to mask out the port offset from the port number cached in ld_qdi->timing. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_legacy.c')
-rw-r--r--drivers/ata/pata_legacy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index da2546b1dda2..5afe3567ebcc 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -672,7 +672,7 @@ static void qdi6580dp_set_piomode(struct ata_port *ap, struct ata_device *adev)
outb(timing, ld_qdi->timing + 2 * ap->port_no);
/* Clear the FIFO */
if (adev->class != ATA_DEV_ATA)
- outb(0x5F, ld_qdi->timing + 3);
+ outb(0x5F, (ld_qdi->timing & 0xFFF0) + 3);
}
/**
@@ -707,7 +707,7 @@ static void qdi6580_set_piomode(struct ata_port *ap, struct ata_device *adev)
outb(timing, ld_qdi->timing + 2 * adev->devno);
/* Clear the FIFO */
if (adev->class != ATA_DEV_ATA)
- outb(0x5F, ld_qdi->timing + 3);
+ outb(0x5F, (ld_qdi->timing & 0xFFF0) + 3);
}
/**