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>

+10 -12
+1 -1
drivers/ide/ide-iops.c
··· 1166 1167 /* 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(). 1170 */ 1171 int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout) 1172 {
··· 1166 1167 /* 1168 * ide_wait_not_busy() waits for the currently selected device on the hwif 1169 + * to report a non-busy status, see comments in ide_probe_port(). 1170 */ 1171 int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout) 1172 {
+7 -9
drivers/ide/ide-probe.c
··· 738 739 EXPORT_SYMBOL_GPL(ide_undecoded_slave); 740 741 - /* 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 { 747 unsigned long flags; 748 unsigned int irqd; 749 int unit; 750 751 if (hwif->noprobe) 752 - return; 753 754 if ((hwif->chipset != ide_4drives || !hwif->mate || !hwif->mate->present) && 755 (ide_hwif_request_regions(hwif))) { 756 printk(KERN_ERR "%s: ports already in use, skipping probe\n", 757 hwif->name); 758 - return; 759 } 760 761 /* ··· 800 801 if (!hwif->present) { 802 ide_hwif_release_regions(hwif); 803 - return; 804 } 805 806 for (unit = 0; unit < MAX_DRIVES; unit++) { ··· 836 else 837 drive->no_io_32bit = drive->id->dword_io ? 1 : 0; 838 } 839 } 840 841 #if MAX_HWIFS > 1 ··· 1309 if (idx[i] == 0xff) 1310 continue; 1311 1312 - probe_hwif(&ide_hwifs[idx[i]]); 1313 } 1314 1315 for (i = 0; i < MAX_HWIFS; i++) {
··· 738 739 EXPORT_SYMBOL_GPL(ide_undecoded_slave); 740 741 + static int ide_probe_port(ide_hwif_t *hwif) 742 { 743 unsigned long flags; 744 unsigned int irqd; 745 int unit; 746 747 if (hwif->noprobe) 748 + return -EACCES; 749 750 if ((hwif->chipset != ide_4drives || !hwif->mate || !hwif->mate->present) && 751 (ide_hwif_request_regions(hwif))) { 752 printk(KERN_ERR "%s: ports already in use, skipping probe\n", 753 hwif->name); 754 + return -EBUSY; 755 } 756 757 /* ··· 804 805 if (!hwif->present) { 806 ide_hwif_release_regions(hwif); 807 + return -ENODEV; 808 } 809 810 for (unit = 0; unit < MAX_DRIVES; unit++) { ··· 840 else 841 drive->no_io_32bit = drive->id->dword_io ? 1 : 0; 842 } 843 + 844 + return 0; 845 } 846 847 #if MAX_HWIFS > 1 ··· 1311 if (idx[i] == 0xff) 1312 continue; 1313 1314 + (void)ide_probe_port(&ide_hwifs[idx[i]]); 1315 } 1316 1317 for (i = 0; i < MAX_HWIFS; i++) {
+2 -2
drivers/ide/pci/ns87415.c
··· 229 230 #ifdef __sparc_v9__ 231 /* 232 - * XXX: Reset the device, if we don't it will not respond 233 - * to SELECT_DRIVE() properly during first probe_hwif(). 234 */ 235 timeout = 10000; 236 outb(12, hwif->io_ports[IDE_CONTROL_OFFSET]);
··· 229 230 #ifdef __sparc_v9__ 231 /* 232 + * XXX: Reset the device, if we don't it will not respond to 233 + * SELECT_DRIVE() properly during first ide_probe_port(). 234 */ 235 timeout = 10000; 236 outb(12, hwif->io_ports[IDE_CONTROL_OFFSET]);