summaryrefslogtreecommitdiff
path: root/drivers/ide/ide-lib.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 22:17:17 +0100
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 22:17:17 +0100
commitd32444771b154c3ec37ebf6439004653560c2411 (patch)
tree953c1a943c6e0fa44898f5ba5ca1c45e65c2ae1c /drivers/ide/ide-lib.c
parentf6e29e35cc0f9facf2eb0b0454f9b09021b5aa6f (diff)
ide: fix registers loading order in ide_dump_ata_status()
Fix registers loading order in ide_dump_ata_status()/ide_read_24(). Load registers in this order: * IDE_SECTOR_REG * IDE_LCYL_REG * IDE_HCYL_REG * IDE_SELECT_REG It shouldn't affect anything (just a usual paranoia to separate changes which change the way in which hardware is accessed from code cleanups). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-lib.c')
-rw-r--r--drivers/ide/ide-lib.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 562f5efae9c6..001085845a79 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -524,19 +524,24 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const char *msg, u8 stat)
(unsigned long long) sectors,
high, low);
} else {
- u8 cur = hwif->INB(IDE_SELECT_REG);
+ u8 sector, lcyl, hcyl, cur;
+
+ sector = hwif->INB(IDE_SECTOR_REG);
+ lcyl = hwif->INB(IDE_LCYL_REG);
+ hcyl = hwif->INB(IDE_HCYL_REG);
+ cur = hwif->INB(IDE_SELECT_REG);
+
if (cur & 0x40) { /* using LBA? */
printk(", LBAsect=%ld", (unsigned long)
- ((cur&0xf)<<24)
- |(hwif->INB(IDE_HCYL_REG)<<16)
- |(hwif->INB(IDE_LCYL_REG)<<8)
- | hwif->INB(IDE_SECTOR_REG));
+ ((cur & 0xf) << 24) |
+ (hcyl << 16) |
+ (lcyl << 8) |
+ sector);
} else {
printk(", CHS=%d/%d/%d",
- (hwif->INB(IDE_HCYL_REG)<<8) +
- hwif->INB(IDE_LCYL_REG),
- cur & 0xf,
- hwif->INB(IDE_SECTOR_REG));
+ (hcyl << 8) + lcyl,
+ cur & 0xf,
+ sector);
}
}
if (HWGROUP(drive) && HWGROUP(drive)->rq)