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