Skip to content

Commit

Permalink
pata_legacy: fix access to control register for QDI6580
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bzolnier authored and Jeff Garzik committed Dec 3, 2009
1 parent 43c7d17 commit 6809e73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/ata/pata_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 6809e73

Please sign in to comment.