jmicron: make ide jmicron driver play nice with libata ones
[powerpc.git] / drivers / ide / pci / sc1200.c
index 778b82a..b5ae0c5 100644 (file)
@@ -11,7 +11,6 @@
  *     Available from National Semiconductor
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -162,7 +161,7 @@ static int sc1200_config_dma2 (ide_drive_t *drive, int mode)
        /*
         * Default to DMA-off in case we run into trouble here.
         */
-       hwif->ide_dma_off_quietly(drive);                       /* turn off DMA while we fiddle */
+       hwif->dma_off_quietly(drive);   /* turn off DMA while we fiddle */
        outb(inb(hwif->dma_base+2)&~(unit?0x40:0x20), hwif->dma_base+2); /* clear DMA_capable bit */
 
        /*
@@ -242,10 +241,7 @@ static int sc1200_config_dma2 (ide_drive_t *drive, int mode)
 
        outb(inb(hwif->dma_base+2)|(unit?0x40:0x20), hwif->dma_base+2); /* set DMA_capable bit */
 
-       /*
-        * Finally, turn DMA on in software, and exit.
-        */
-       return hwif->ide_dma_on(drive); /* success */
+       return 0;       /* success */
 }
 
 /*
@@ -324,6 +320,7 @@ static void sc1200_tuneproc (ide_drive_t *drive, byte pio)  /* mode=255 means "au
        }
 }
 
+#ifdef CONFIG_PM
 static ide_hwif_t *lookup_pci_dev (ide_hwif_t *prev, struct pci_dev *dev)
 {
        int     h;
@@ -442,16 +439,17 @@ static int sc1200_resume (struct pci_dev *dev)
                        ide_drive_t *drive = &(hwif->drives[d]);
                        if (drive->present && !__ide_dma_bad_drive(drive)) {
                                int was_using_dma = drive->using_dma;
-                               hwif->ide_dma_off_quietly(drive);
+                               hwif->dma_off_quietly(drive);
                                sc1200_config_dma(drive);
                                if (!was_using_dma && drive->using_dma) {
-                                       hwif->ide_dma_off_quietly(drive);
+                                       hwif->dma_off_quietly(drive);
                                }
                        }
                }
        }
        return 0;
 }
+#endif
 
 /*
  * This gets invoked by the IDE driver once for each channel,
@@ -500,11 +498,13 @@ static struct pci_driver driver = {
        .name           = "SC1200_IDE",
        .id_table       = sc1200_pci_tbl,
        .probe          = sc1200_init_one,
+#ifdef CONFIG_PM
        .suspend        = sc1200_suspend,
        .resume         = sc1200_resume,
+#endif
 };
 
-static int sc1200_ide_init(void)
+static int __init sc1200_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }