]> err.no Git - linux-2.6/blobdiff - drivers/ide/legacy/dtc2278.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[linux-2.6] / drivers / ide / legacy / dtc2278.c
index f2903b6e43c02e5567af8f2c9771cfa72d1671ac..f165212548673729f412bbfb031aea67ba20c49c 100644 (file)
@@ -67,12 +67,10 @@ static void sub22 (char b, char c)
        }
 }
 
-static void tune_dtc2278 (ide_drive_t *drive, u8 pio)
+static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
 {
        unsigned long flags;
 
-       pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
-
        if (pio >= 3) {
                spin_lock_irqsave(&ide_lock, flags);
                /*
@@ -92,7 +90,7 @@ static void tune_dtc2278 (ide_drive_t *drive, u8 pio)
        HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1;
 }
 
-static int __init probe_dtc2278(void)
+static int __init dtc2278_probe(void)
 {
        unsigned long flags;
        ide_hwif_t *hwif, *mate;
@@ -123,7 +121,8 @@ static int __init probe_dtc2278(void)
 
        hwif->serialized = 1;
        hwif->chipset = ide_dtc2278;
-       hwif->tuneproc = &tune_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->mate = mate;
@@ -138,15 +137,24 @@ static int __init probe_dtc2278(void)
        probe_hwif_init(hwif);
        probe_hwif_init(mate);
 
-       create_proc_ide_interfaces();
+       ide_proc_register_port(hwif);
+       ide_proc_register_port(mate);
 
        return 0;
 }
 
+int probe_dtc2278 = 0;
+
+module_param_named(probe, probe_dtc2278, bool, 0);
+MODULE_PARM_DESC(probe, "probe for DTC2278xx chipsets");
+
 /* Can be called directly from ide.c. */
 int __init dtc2278_init(void)
 {
-       if (probe_dtc2278()) {
+       if (probe_dtc2278 == 0)
+               return -ENODEV;
+
+       if (dtc2278_probe()) {
                printk(KERN_ERR "dtc2278: ide interfaces already in use!\n");
                return -EBUSY;
        }