From ddf151026a293725507fedc39b18ae6edb86d775 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 13 Oct 2007 17:47:49 +0200 Subject: ide-pmac: use __ide_wait_stat() * Use __ide_wait_stat() instead of wait_for_ready() in pmac_ide_do_setfeature(). While at it do following changes to match __ide_wait_stat() call in ide_config_drive_speed(): * Wait WAIT_CMD time (20 sec) instead of 2 sec for device to clear BUSY_STAT. * Check DRQ_STAT bit (shouldn't be set for good device status). Also remove no longer needed wait_for_ready() from ide-iops.c. Acked-by: Benjamin Herrenschmidt Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ppc/pmac.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/ide/ppc') diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 512452b379b..13e26642dad 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -541,7 +541,8 @@ static int pmac_ide_do_setfeature(ide_drive_t *drive, u8 command) { ide_hwif_t *hwif = HWIF(drive); - int result = 1; + int result; + u8 stat; disable_irq_nosync(hwif->irq); udelay(1); @@ -552,9 +553,9 @@ pmac_ide_do_setfeature(ide_drive_t *drive, u8 command) hwif->OUTB(command, IDE_NSECTOR_REG); hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG); hwif->OUTBSYNC(drive, WIN_SETFEATURES, IDE_COMMAND_REG); - udelay(1); - /* Timeout bumped for some powerbooks */ - result = wait_for_ready(drive, 2000); + result = __ide_wait_stat(drive, drive->ready_stat, + BUSY_STAT|DRQ_STAT|ERR_STAT, + WAIT_CMD, &stat); hwif->OUTB(drive->ctl, IDE_CONTROL_REG); if (result) printk(KERN_ERR "%s: pmac_ide_do_setfeature disk not ready " -- cgit v1.2.3