From: Bartlomiej Zolnierkiewicz Date: Thu, 3 Dec 2009 19:32:11 +0000 (+0100) Subject: pata_legacy: fix access to control register for QDI6580 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6809e7301fba4f9fa446ead5167faed115690fc4;p=linux-beck.git 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 Signed-off-by: Jeff Garzik --- 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); } /**