aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-probe.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 56fb0b843429..ee848c705995 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -644,7 +644,7 @@ static void hwif_register (ide_hwif_t *hwif)
644 644
645static int wait_hwif_ready(ide_hwif_t *hwif) 645static int wait_hwif_ready(ide_hwif_t *hwif)
646{ 646{
647 int rc; 647 int unit, rc;
648 648
649 printk(KERN_DEBUG "Probing IDE interface %s...\n", hwif->name); 649 printk(KERN_DEBUG "Probing IDE interface %s...\n", hwif->name);
650 650
@@ -661,20 +661,26 @@ static int wait_hwif_ready(ide_hwif_t *hwif)
661 return rc; 661 return rc;
662 662
663 /* Now make sure both master & slave are ready */ 663 /* Now make sure both master & slave are ready */
664 SELECT_DRIVE(&hwif->drives[0]); 664 for (unit = 0; unit < MAX_DRIVES; unit++) {
665 hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]); 665 ide_drive_t *drive = &hwif->drives[unit];
666 mdelay(2);
667 rc = ide_wait_not_busy(hwif, 35000);
668 if (rc)
669 return rc;
670 SELECT_DRIVE(&hwif->drives[1]);
671 hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
672 mdelay(2);
673 rc = ide_wait_not_busy(hwif, 35000);
674 666
667 /* Ignore disks that we will not probe for later. */
668 if (!drive->noprobe || drive->present) {
669 SELECT_DRIVE(drive);
670 hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
671 mdelay(2);
672 rc = ide_wait_not_busy(hwif, 35000);
673 if (rc)
674 goto out;
675 } else
676 printk(KERN_DEBUG "%s: ide_wait_not_busy() skipped\n",
677 drive->name);
678 }
679out:
675 /* Exit function with master reselected (let's be sane) */ 680 /* Exit function with master reselected (let's be sane) */
676 SELECT_DRIVE(&hwif->drives[0]); 681 if (unit)
677 682 SELECT_DRIVE(&hwif->drives[0]);
683
678 return rc; 684 return rc;
679} 685}
680 686