]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ide: factor out cable detection from ide_init_port()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 17 Apr 2008 22:46:22 +0000 (00:46 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 17 Apr 2008 22:46:22 +0000 (00:46 +0200)
* 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>
drivers/ide/ide-probe.c

index 47a114927c318ffc4b22229c59eb5e97db9e539f..9db8978ad3949b4267409cc5b86454228b6117d0 100644 (file)
@@ -1366,7 +1366,10 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
        /* call chipset specific routine for each enabled port */
        if (d->init_hwif)
                d->init_hwif(hwif);
+}
 
+static void ide_port_cable_detect(ide_hwif_t *hwif)
+{
        if (hwif->cable_detect && (hwif->ultra_mask & 0x78)) {
                if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                        hwif->cbl = hwif->cable_detect(hwif);
@@ -1394,6 +1397,7 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
                mate = (i & 1) ? NULL : hwif;
 
                ide_init_port(hwif, i & 1, d);
+               ide_port_cable_detect(hwif);
                ide_port_init_devices(hwif);
        }