diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:36 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:36 -0500 |
commit | 9d501529b688dada3fd90d91b1517e48d5ac3e05 (patch) | |
tree | 455d4f52979dd11abc1ef6dbd3c01128e03118d1 /drivers/ide/ide-probe.c | |
parent | fbd130887a45341259cde02e134581fb3dac6e14 (diff) |
ide: make probe_hwif() return an error value
Make probe_hwif() return an error value.
While at it:
* Remove comment about MAX_DRIVES == 2 limitation (it is not special to
probe_hwif(), it is a general assumption taken by a lot of IDE code).
* Rename probe_hwif() to ide_probe_port().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 3acb1b692f8c..2395498fbc7b 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -738,24 +738,20 @@ void ide_undecoded_slave(ide_drive_t *drive1) | |||
738 | 738 | ||
739 | EXPORT_SYMBOL_GPL(ide_undecoded_slave); | 739 | EXPORT_SYMBOL_GPL(ide_undecoded_slave); |
740 | 740 | ||
741 | /* | 741 | static int ide_probe_port(ide_hwif_t *hwif) |
742 | * This routine only knows how to look for drive units 0 and 1 | ||
743 | * on an interface, so any setting of MAX_DRIVES > 2 won't work here. | ||
744 | */ | ||
745 | static void probe_hwif(ide_hwif_t *hwif) | ||
746 | { | 742 | { |
747 | unsigned long flags; | 743 | unsigned long flags; |
748 | unsigned int irqd; | 744 | unsigned int irqd; |
749 | int unit; | 745 | int unit; |
750 | 746 | ||
751 | if (hwif->noprobe) | 747 | if (hwif->noprobe) |
752 | return; | 748 | return -EACCES; |
753 | 749 | ||
754 | if ((hwif->chipset != ide_4drives || !hwif->mate || !hwif->mate->present) && | 750 | if ((hwif->chipset != ide_4drives || !hwif->mate || !hwif->mate->present) && |
755 | (ide_hwif_request_regions(hwif))) { | 751 | (ide_hwif_request_regions(hwif))) { |
756 | printk(KERN_ERR "%s: ports already in use, skipping probe\n", | 752 | printk(KERN_ERR "%s: ports already in use, skipping probe\n", |
757 | hwif->name); | 753 | hwif->name); |
758 | return; | 754 | return -EBUSY; |
759 | } | 755 | } |
760 | 756 | ||
761 | /* | 757 | /* |
@@ -804,7 +800,7 @@ static void probe_hwif(ide_hwif_t *hwif) | |||
804 | 800 | ||
805 | if (!hwif->present) { | 801 | if (!hwif->present) { |
806 | ide_hwif_release_regions(hwif); | 802 | ide_hwif_release_regions(hwif); |
807 | return; | 803 | return -ENODEV; |
808 | } | 804 | } |
809 | 805 | ||
810 | for (unit = 0; unit < MAX_DRIVES; unit++) { | 806 | for (unit = 0; unit < MAX_DRIVES; unit++) { |
@@ -840,6 +836,8 @@ static void probe_hwif(ide_hwif_t *hwif) | |||
840 | else | 836 | else |
841 | drive->no_io_32bit = drive->id->dword_io ? 1 : 0; | 837 | drive->no_io_32bit = drive->id->dword_io ? 1 : 0; |
842 | } | 838 | } |
839 | |||
840 | return 0; | ||
843 | } | 841 | } |
844 | 842 | ||
845 | #if MAX_HWIFS > 1 | 843 | #if MAX_HWIFS > 1 |
@@ -1311,7 +1309,7 @@ int ide_device_add_all(u8 *idx) | |||
1311 | if (idx[i] == 0xff) | 1309 | if (idx[i] == 0xff) |
1312 | continue; | 1310 | continue; |
1313 | 1311 | ||
1314 | probe_hwif(&ide_hwifs[idx[i]]); | 1312 | (void)ide_probe_port(&ide_hwifs[idx[i]]); |
1315 | } | 1313 | } |
1316 | 1314 | ||
1317 | for (i = 0; i < MAX_HWIFS; i++) { | 1315 | for (i = 0; i < MAX_HWIFS; i++) { |