]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/legacy/dtc2278.c
Merge branch 'agp-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[linux-2.6-omap-h63xx.git] / drivers / ide / legacy / dtc2278.c
index 73396f70f2b74c6aed1b5a7c41da3dde495d4fe2..689b2e493413412a235202ee5eb742a78440a082 100644 (file)
 #include <linux/mm.h>
 #include <linux/ioport.h>
 #include <linux/blkdev.h>
-#include <linux/hdreg.h>
 #include <linux/ide.h>
 #include <linux/init.h>
 
 #include <asm/io.h>
 
+#define DRV_NAME "dtc2278"
+
 /*
  * Changing this #undef to #define may solve start up problems in some systems.
  */
@@ -86,29 +87,26 @@ static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
        }
 }
 
+static const struct ide_port_ops dtc2278_port_ops = {
+       .set_pio_mode           = dtc2278_set_pio_mode,
+};
+
 static const struct ide_port_info dtc2278_port_info __initdata = {
+       .name                   = DRV_NAME,
        .chipset                = ide_dtc2278,
+       .port_ops               = &dtc2278_port_ops,
        .host_flags             = IDE_HFLAG_SERIALIZE |
                                  IDE_HFLAG_NO_UNMASK_IRQS |
                                  IDE_HFLAG_IO_32BIT |
                                  /* disallow ->io_32bit changes */
                                  IDE_HFLAG_NO_IO_32BIT |
-                                 IDE_HFLAG_NO_DMA |
-                                 IDE_HFLAG_NO_AUTOTUNE,
+                                 IDE_HFLAG_NO_DMA,
        .pio_mask               = ATA_PIO4,
 };
 
 static int __init dtc2278_probe(void)
 {
        unsigned long flags;
-       ide_hwif_t *hwif, *mate;
-       static u8 idx[4] = { 0, 1, 0xff, 0xff };
-
-       hwif = &ide_hwifs[0];
-       mate = &ide_hwifs[1];
-
-       if (hwif->chipset != ide_unknown || mate->chipset != ide_unknown)
-               return 1;
 
        local_irq_save(flags);
        /*
@@ -128,14 +126,10 @@ static int __init dtc2278_probe(void)
 #endif
        local_irq_restore(flags);
 
-       hwif->set_pio_mode = &dtc2278_set_pio_mode;
-
-       ide_device_add(idx, &dtc2278_port_info);
-
-       return 0;
+       return ide_legacy_device_add(&dtc2278_port_info, 0);
 }
 
-int probe_dtc2278 = 0;
+static int probe_dtc2278;
 
 module_param_named(probe, probe_dtc2278, bool, 0);
 MODULE_PARM_DESC(probe, "probe for DTC2278xx chipsets");