diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:34 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:34 -0500 |
commit | c860a8f2d29b7da84fb3aed7b097f53c2c225fd6 (patch) | |
tree | f78675adbd5cacf4fc64846b67e7c972aa316cff /drivers/ide/ide-probe.c | |
parent | cf7125ae05e5ac671eec2508656816bbc0a8c723 (diff) |
ide: move wait_hwif_ready() documentation in the right place
* Move wait_hwif_ready() documentation before this function.
* Fix trailing whitespaces.
* s/wait-for-busy/wait-for-non-busy/
* Remove no longer valid comment about the current code behavior.
* Docbook-ize it.
* Rename wait_hwif_ready() to ide_port_wait_ready().
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 873471dfb9b3..b812b98744e8 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -634,7 +634,33 @@ static void hwif_register (ide_hwif_t *hwif) | |||
634 | __FUNCTION__, ret); | 634 | __FUNCTION__, ret); |
635 | } | 635 | } |
636 | 636 | ||
637 | static int wait_hwif_ready(ide_hwif_t *hwif) | 637 | /** |
638 | * ide_port_wait_ready - wait for port to become ready | ||
639 | * @hwif: IDE port | ||
640 | * | ||
641 | * This is needed on some PPCs and a bunch of BIOS-less embedded | ||
642 | * platforms. Typical cases are: | ||
643 | * | ||
644 | * - The firmware hard reset the disk before booting the kernel, | ||
645 | * the drive is still doing it's poweron-reset sequence, that | ||
646 | * can take up to 30 seconds. | ||
647 | * | ||
648 | * - The firmware does nothing (or no firmware), the device is | ||
649 | * still in POST state (same as above actually). | ||
650 | * | ||
651 | * - Some CD/DVD/Writer combo drives tend to drive the bus during | ||
652 | * their reset sequence even when they are non-selected slave | ||
653 | * devices, thus preventing discovery of the main HD. | ||
654 | * | ||
655 | * Doing this wait-for-non-busy should not harm any existing | ||
656 | * configuration and fix some issues like the above. | ||
657 | * | ||
658 | * BenH. | ||
659 | * | ||
660 | * Returns 0 on success, error code (< 0) otherwise. | ||
661 | */ | ||
662 | |||
663 | static int ide_port_wait_ready(ide_hwif_t *hwif) | ||
638 | { | 664 | { |
639 | int unit, rc; | 665 | int unit, rc; |
640 | 666 | ||
@@ -742,26 +768,7 @@ static void probe_hwif(ide_hwif_t *hwif) | |||
742 | 768 | ||
743 | local_irq_set(flags); | 769 | local_irq_set(flags); |
744 | 770 | ||
745 | /* This is needed on some PPCs and a bunch of BIOS-less embedded | 771 | if (ide_port_wait_ready(hwif) == -EBUSY) |
746 | * platforms. Typical cases are: | ||
747 | * | ||
748 | * - The firmware hard reset the disk before booting the kernel, | ||
749 | * the drive is still doing it's poweron-reset sequence, that | ||
750 | * can take up to 30 seconds | ||
751 | * - The firmware does nothing (or no firmware), the device is | ||
752 | * still in POST state (same as above actually). | ||
753 | * - Some CD/DVD/Writer combo drives tend to drive the bus during | ||
754 | * their reset sequence even when they are non-selected slave | ||
755 | * devices, thus preventing discovery of the main HD | ||
756 | * | ||
757 | * Doing this wait-for-busy should not harm any existing configuration | ||
758 | * (at least things won't be worse than what current code does, that | ||
759 | * is blindly go & talk to the drive) and fix some issues like the | ||
760 | * above. | ||
761 | * | ||
762 | * BenH. | ||
763 | */ | ||
764 | if (wait_hwif_ready(hwif) == -EBUSY) | ||
765 | printk(KERN_DEBUG "%s: Wait for ready failed before probe !\n", hwif->name); | 772 | printk(KERN_DEBUG "%s: Wait for ready failed before probe !\n", hwif->name); |
766 | 773 | ||
767 | /* | 774 | /* |