diff options
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r-- | drivers/ide/ide-iops.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 004803030f64..a940d127aae3 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -666,7 +666,7 @@ int ide_driveid_update(ide_drive_t *drive) | |||
666 | ide_hwif_t *hwif = drive->hwif; | 666 | ide_hwif_t *hwif = drive->hwif; |
667 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; | 667 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; |
668 | u16 *id; | 668 | u16 *id; |
669 | unsigned long timeout, flags; | 669 | unsigned long flags; |
670 | u8 stat; | 670 | u8 stat; |
671 | 671 | ||
672 | /* | 672 | /* |
@@ -678,16 +678,11 @@ int ide_driveid_update(ide_drive_t *drive) | |||
678 | tp_ops->set_irq(hwif, 0); | 678 | tp_ops->set_irq(hwif, 0); |
679 | msleep(50); | 679 | msleep(50); |
680 | tp_ops->exec_command(hwif, ATA_CMD_ID_ATA); | 680 | tp_ops->exec_command(hwif, ATA_CMD_ID_ATA); |
681 | timeout = jiffies + WAIT_WORSTCASE; | ||
682 | do { | ||
683 | if (time_after(jiffies, timeout)) { | ||
684 | SELECT_MASK(drive, 0); | ||
685 | return 0; /* drive timed-out */ | ||
686 | } | ||
687 | 681 | ||
688 | msleep(50); /* give drive a breather */ | 682 | if (ide_busy_sleep(hwif, WAIT_WORSTCASE, 1)) { |
689 | stat = tp_ops->read_altstatus(hwif); | 683 | SELECT_MASK(drive, 0); |
690 | } while (stat & ATA_BUSY); | 684 | return 0; |
685 | } | ||
691 | 686 | ||
692 | msleep(50); /* wait for IRQ and ATA_DRQ */ | 687 | msleep(50); /* wait for IRQ and ATA_DRQ */ |
693 | stat = tp_ops->read_status(hwif); | 688 | stat = tp_ops->read_status(hwif); |