Merge to kernel-2.6.20-1.2949.fc6.vs2.2.0.1
[linux-2.6.git] / drivers / ide / pci / cs5520.c
index 5c915e4..ba6786a 100644 (file)
@@ -32,7 +32,6 @@
  *
  */
  
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -47,6 +46,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/ide.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -158,11 +158,10 @@ static void __devinit cs5520_init_setup_dma(struct pci_dev *dev, ide_pci_device_
  *     DMA channel
  */
  
-static int cs5520_dma_setup(ide_drive_t *drive)
+static int cs5520_dma_on(ide_drive_t *drive)
 {
-       /* If DMA setup works then VDMA on */
-       drive->vdma = ide_dma_setup(drive) ? 1: 0;
-       return drive->vdma;
+       drive->vdma = 1;
+       return 0;
 }
 
 static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
@@ -170,7 +169,7 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
        hwif->tuneproc = &cs5520_tune_drive;
        hwif->speedproc = &cs5520_tune_chipset;
        hwif->ide_dma_check = &cs5520_config_drive_xfer_rate;
-       hwif->ide_dma_setup = &cs5520_dma_setup;
+       hwif->ide_dma_on = &cs5520_dma_on;
 
        if(!noautodma)
                hwif->autodma = 1;
@@ -222,13 +221,12 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
 
        /* We must not grab the entire device, it has 'ISA' space in its
           BARS too and we will freak out other bits of the kernel */
-       if(pci_enable_device_bars(dev, 1<<2))
-       {
+       if (pci_enable_device_bars(dev, 1<<2)) {
                printk(KERN_WARNING "%s: Unable to enable 55x0.\n", d->name);
-               return -EBUSY;
+               return -ENODEV;
        }
        pci_set_master(dev);
-       if (pci_set_dma_mask(dev, 0xFFFFFFFF)) {
+       if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) {
                printk(KERN_WARNING "cs5520: No suitable DMA available.\n");
                return -ENODEV;
        }
@@ -262,7 +260,7 @@ static struct pci_driver driver = {
        .probe          = cs5520_init_one,
 };
 
-static int cs5520_ide_init(void)
+static int __init cs5520_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }