aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-iops.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:21 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:21 -0400
commit3a7d24841ad794ae64c90d7d00d62a83741912aa (patch)
treed71a36678fa88ed1e0b279390b6169f5018186bf /drivers/ide/ide-iops.c
parentf26b3d75959e9a0e43a2e1e1148c075592746c3d (diff)
ide: use ATA_* defines instead of *_STAT and *_ERR ones
* ERR_STAT -> ATA_ERR * INDEX_STAT -> ATA_IDX * ECC_STAT -> ATA_CORR * DRQ_STAT -> ATA_DRQ * SEEK_STAT -> ATA_DSC * WRERR_STAT -> ATA_DF * READY_STAT -> ATA_DRDY * BUSY_STAT -> ATA_BUSY * MARK_ERR -> ATA_AMNF * TRK0_ERR -> ATA_TRK0NF * ABRT_ERR -> ATA_ABORTED * MCR_ERR -> ATA_MCR * ID_ERR -> ATA_IDNF * MC_ERR -> ATA_MC * ECC_ERR -> ATA_UNC * ICRC_ERR -> ATA_ICRC * BBD_ERR -> ATA_BBK Also: * ILI_ERR -> ATAPI_ILI * EOM_ERR -> ATAPI_EOM * LFS_ERR -> ATAPI_LFS * CD -> ATAPI_COD * IO -> ATAPI_IO Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r--drivers/ide/ide-iops.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 21647a2eaff9..8cfa6125c7a4 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -473,7 +473,7 @@ int drive_is_ready (ide_drive_t *drive)
473 /* Note: this may clear a pending IRQ!! */ 473 /* Note: this may clear a pending IRQ!! */
474 stat = hwif->tp_ops->read_status(hwif); 474 stat = hwif->tp_ops->read_status(hwif);
475 475
476 if (stat & BUSY_STAT) 476 if (stat & ATA_BUSY)
477 /* drive busy: definitely not interrupting */ 477 /* drive busy: definitely not interrupting */
478 return 0; 478 return 0;
479 479
@@ -505,10 +505,10 @@ static int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, unsigned long ti
505 udelay(1); /* spec allows drive 400ns to assert "BUSY" */ 505 udelay(1); /* spec allows drive 400ns to assert "BUSY" */
506 stat = tp_ops->read_status(hwif); 506 stat = tp_ops->read_status(hwif);
507 507
508 if (stat & BUSY_STAT) { 508 if (stat & ATA_BUSY) {
509 local_irq_set(flags); 509 local_irq_set(flags);
510 timeout += jiffies; 510 timeout += jiffies;
511 while ((stat = tp_ops->read_status(hwif)) & BUSY_STAT) { 511 while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) {
512 if (time_after(jiffies, timeout)) { 512 if (time_after(jiffies, timeout)) {
513 /* 513 /*
514 * One last read after the timeout in case 514 * One last read after the timeout in case
@@ -516,7 +516,7 @@ static int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, unsigned long ti
516 * progress during the timeout.. 516 * progress during the timeout..
517 */ 517 */
518 stat = tp_ops->read_status(hwif); 518 stat = tp_ops->read_status(hwif);
519 if (!(stat & BUSY_STAT)) 519 if ((stat & ATA_BUSY) == 0)
520 break; 520 break;
521 521
522 local_irq_restore(flags); 522 local_irq_restore(flags);
@@ -685,12 +685,12 @@ int ide_driveid_update(ide_drive_t *drive)
685 685
686 msleep(50); /* give drive a breather */ 686 msleep(50); /* give drive a breather */
687 stat = tp_ops->read_altstatus(hwif); 687 stat = tp_ops->read_altstatus(hwif);
688 } while (stat & BUSY_STAT); 688 } while (stat & ATA_BUSY);
689 689
690 msleep(50); /* wait for IRQ and DRQ_STAT */ 690 msleep(50); /* wait for IRQ and ATA_DRQ */
691 stat = tp_ops->read_status(hwif); 691 stat = tp_ops->read_status(hwif);
692 692
693 if (!OK_STAT(stat, DRQ_STAT, BAD_R_STAT)) { 693 if (!OK_STAT(stat, ATA_DRQ, BAD_R_STAT)) {
694 SELECT_MASK(drive, 0); 694 SELECT_MASK(drive, 0);
695 printk("%s: CHECK for good STATUS\n", drive->name); 695 printk("%s: CHECK for good STATUS\n", drive->name);
696 return 0; 696 return 0;
@@ -776,7 +776,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
776 tp_ops->set_irq(hwif, 1); 776 tp_ops->set_irq(hwif, 1);
777 777
778 error = __ide_wait_stat(drive, drive->ready_stat, 778 error = __ide_wait_stat(drive, drive->ready_stat,
779 BUSY_STAT|DRQ_STAT|ERR_STAT, 779 ATA_BUSY | ATA_DRQ | ATA_ERR,
780 WAIT_CMD, &stat); 780 WAIT_CMD, &stat);
781 781
782 SELECT_MASK(drive, 0); 782 SELECT_MASK(drive, 0);
@@ -923,7 +923,7 @@ static ide_startstop_t atapi_reset_pollfunc (ide_drive_t *drive)
923 udelay (10); 923 udelay (10);
924 stat = hwif->tp_ops->read_status(hwif); 924 stat = hwif->tp_ops->read_status(hwif);
925 925
926 if (OK_STAT(stat, 0, BUSY_STAT)) 926 if (OK_STAT(stat, 0, ATA_BUSY))
927 printk("%s: ATAPI reset complete\n", drive->name); 927 printk("%s: ATAPI reset complete\n", drive->name);
928 else { 928 else {
929 if (time_before(jiffies, hwgroup->poll_timeout)) { 929 if (time_before(jiffies, hwgroup->poll_timeout)) {
@@ -969,7 +969,7 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
969 969
970 tmp = hwif->tp_ops->read_status(hwif); 970 tmp = hwif->tp_ops->read_status(hwif);
971 971
972 if (!OK_STAT(tmp, 0, BUSY_STAT)) { 972 if (!OK_STAT(tmp, 0, ATA_BUSY)) {
973 if (time_before(jiffies, hwgroup->poll_timeout)) { 973 if (time_before(jiffies, hwgroup->poll_timeout)) {
974 ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL); 974 ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL);
975 /* continue polling */ 975 /* continue polling */
@@ -1183,7 +1183,7 @@ int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout)
1183 */ 1183 */
1184 mdelay(1); 1184 mdelay(1);
1185 stat = hwif->tp_ops->read_status(hwif); 1185 stat = hwif->tp_ops->read_status(hwif);
1186 if ((stat & BUSY_STAT) == 0) 1186 if ((stat & ATA_BUSY) == 0)
1187 return 0; 1187 return 0;
1188 /* 1188 /*
1189 * Assume a value of 0xff means nothing is connected to 1189 * Assume a value of 0xff means nothing is connected to