aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:22 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:22 -0400
commitc7f6f21aaeb826a9b04b5897a92f29226995170f (patch)
tree477ae32fb4a2311e15a6ef8ff9df58177cd69092
parent8f22a72bf52e76d6bcd11bf9e695fdde61bd454c (diff)
ide: factor out cable detection from ide_init_port()
* Factor out cable detection from ide_init_port() to ide_port_cable_detect(). * Move ide_port_cable_detect() call to ide_device_add_all(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-probe.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 47a114927c31..9db8978ad394 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1366,7 +1366,10 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
1366 /* call chipset specific routine for each enabled port */ 1366 /* call chipset specific routine for each enabled port */
1367 if (d->init_hwif) 1367 if (d->init_hwif)
1368 d->init_hwif(hwif); 1368 d->init_hwif(hwif);
1369}
1369 1370
1371static void ide_port_cable_detect(ide_hwif_t *hwif)
1372{
1370 if (hwif->cable_detect && (hwif->ultra_mask & 0x78)) { 1373 if (hwif->cable_detect && (hwif->ultra_mask & 0x78)) {
1371 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 1374 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
1372 hwif->cbl = hwif->cable_detect(hwif); 1375 hwif->cbl = hwif->cable_detect(hwif);
@@ -1394,6 +1397,7 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
1394 mate = (i & 1) ? NULL : hwif; 1397 mate = (i & 1) ? NULL : hwif;
1395 1398
1396 ide_init_port(hwif, i & 1, d); 1399 ide_init_port(hwif, i & 1, d);
1400 ide_port_cable_detect(hwif);
1397 ide_port_init_devices(hwif); 1401 ide_port_init_devices(hwif);
1398 } 1402 }
1399 1403