ide: factor out code for tuning devices from ide_probe_port()

* Factor out code for tuning devices from ide_probe_port()
to ide_port_tune_devices().

* Move ide_port_tune_devices() call from ide_probe_port()
to ide_device_add_all().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

+12 -3
+12 -3
drivers/ide/ide-probe.c
··· 794 if (!hwif->present) 795 return -ENODEV; 796 797 for (unit = 0; unit < MAX_DRIVES; unit++) { 798 ide_drive_t *drive = &hwif->drives[unit]; 799 ··· 834 else 835 drive->no_io_32bit = drive->id->dword_io ? 1 : 0; 836 } 837 - 838 - return 0; 839 } 840 841 #if MAX_HWIFS > 1 ··· 1314 continue; 1315 } 1316 1317 - if (ide_probe_port(hwif) < 0) 1318 ide_hwif_release_regions(hwif); 1319 } 1320 1321 for (i = 0; i < MAX_HWIFS; i++) {
··· 794 if (!hwif->present) 795 return -ENODEV; 796 797 + return 0; 798 + } 799 + 800 + static void ide_port_tune_devices(ide_hwif_t *hwif) 801 + { 802 + int unit; 803 + 804 for (unit = 0; unit < MAX_DRIVES; unit++) { 805 ide_drive_t *drive = &hwif->drives[unit]; 806 ··· 827 else 828 drive->no_io_32bit = drive->id->dword_io ? 1 : 0; 829 } 830 } 831 832 #if MAX_HWIFS > 1 ··· 1309 continue; 1310 } 1311 1312 + if (ide_probe_port(hwif) < 0) { 1313 ide_hwif_release_regions(hwif); 1314 + continue; 1315 + } 1316 + 1317 + ide_port_tune_devices(hwif); 1318 } 1319 1320 for (i = 0; i < MAX_HWIFS; i++) {