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 | |
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>
-rw-r--r-- | drivers/ide/ide-iops.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-probe.c | 16 | ||||
-rw-r--r-- | drivers/ide/pci/ns87415.c | 4 |
3 files changed, 10 insertions, 12 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 495e3878e42e..16b1f6e12781 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -1166,7 +1166,7 @@ EXPORT_SYMBOL(ide_do_reset); | |||
1166 | 1166 | ||
1167 | /* | 1167 | /* |
1168 | * ide_wait_not_busy() waits for the currently selected device on the hwif | 1168 | * ide_wait_not_busy() waits for the currently selected device on the hwif |
1169 | * to report a non-busy status, see comments in probe_hwif(). | 1169 | * to report a non-busy status, see comments in ide_probe_port(). |
1170 | */ | 1170 | */ |
1171 | int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout) | 1171 | int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout) |
1172 | { | 1172 | { |
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++) { |
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c index d50caa082d50..fc9eee9ccac3 100644 --- a/drivers/ide/pci/ns87415.c +++ b/drivers/ide/pci/ns87415.c | |||
@@ -229,8 +229,8 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) | |||
229 | 229 | ||
230 | #ifdef __sparc_v9__ | 230 | #ifdef __sparc_v9__ |
231 | /* | 231 | /* |
232 | * XXX: Reset the device, if we don't it will not respond | 232 | * XXX: Reset the device, if we don't it will not respond to |
233 | * to SELECT_DRIVE() properly during first probe_hwif(). | 233 | * SELECT_DRIVE() properly during first ide_probe_port(). |
234 | */ | 234 | */ |
235 | timeout = 10000; | 235 | timeout = 10000; |
236 | outb(12, hwif->io_ports[IDE_CONTROL_OFFSET]); | 236 | outb(12, hwif->io_ports[IDE_CONTROL_OFFSET]); |