]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
dtc2278: fix ->io_32bit handling
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 2 Feb 2008 18:56:28 +0000 (19:56 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 2 Feb 2008 18:56:28 +0000 (19:56 +0100)
On DTC2278 32-bit I/O has to be enabled for both devices on the port
so always enable it during init time and disallow further changes.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide.c
drivers/ide/legacy/dtc2278.c

index ab9ca2b5b66cdd25d6e6d60a6559f8823cee47b1..fb0c47c8819defcca9ac9f0e9723ee96ccaa66d8 100644 (file)
@@ -791,10 +791,6 @@ int set_io_32bit(ide_drive_t *drive, int arg)
                return -EBUSY;
 
        drive->io_32bit = arg;
-#ifdef CONFIG_BLK_DEV_DTC2278
-       if (HWIF(drive)->chipset == ide_dtc2278)
-               HWIF(drive)->drives[!drive->select.b.unit].io_32bit = arg;
-#endif /* CONFIG_BLK_DEV_DTC2278 */
 
        spin_unlock_irq(&ide_lock);
 
index 611c9705a3aec88946b8b82c547a9eea9b23bf51..092c04abbe7a1903dd0b4faa3f0adc491b30a457 100644 (file)
@@ -84,12 +84,6 @@ static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
                /* Actually we do - there is a data sheet available for the
                   Winbond but does anyone actually care */
        }
-
-       /*
-        * 32bit I/O has to be enabled for *both* drives at the same time.
-        */
-       drive->io_32bit = 1;
-       HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1;
 }
 
 static int __init dtc2278_probe(void)
@@ -123,18 +117,24 @@ static int __init dtc2278_probe(void)
        local_irq_restore(flags);
 
        hwif->serialized = 1;
+       hwif->no_io_32bit = 1;  /* disallow ->io_32bit changes */
        hwif->chipset = ide_dtc2278;
        hwif->pio_mask = ATA_PIO4;
        hwif->set_pio_mode = &dtc2278_set_pio_mode;
        hwif->drives[0].no_unmask = 1;
        hwif->drives[1].no_unmask = 1;
+       hwif->drives[0].io_32bit = 1;
+       hwif->drives[1].io_32bit = 1;
        hwif->mate = mate;
 
        mate->serialized = 1;
+       mate->no_io_32bit = 1;
        mate->chipset = ide_dtc2278;
        mate->pio_mask = ATA_PIO4;
        mate->drives[0].no_unmask = 1;
        mate->drives[1].no_unmask = 1;
+       mate->drives[0].io_32bit = 1;
+       mate->drives[1].io_32bit = 1;
        mate->mate = hwif;
        mate->channel = 1;