Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
[sfrench/cifs-2.6.git] / drivers / ide / pci / sgiioc4.c
index 9a9474f534e5e8a7676236c8c8c67d87e187f7d8..7e9dade5648d4e13e20df4cb125f5a5351cba4a5 100644 (file)
@@ -582,7 +582,6 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
        hwif->pre_reset = NULL; /* No HBA specific pre_set needed */
        hwif->resetproc = &sgiioc4_resetproc;/* Reset DMA engine,
                                                clear interrupts */
-       hwif->intrproc = NULL;  /* Enable or Disable interrupt from drive */
        hwif->maskproc = &sgiioc4_maskproc;     /* Mask on/off NIEN register */
        hwif->quirkproc = NULL;
        hwif->busproc = NULL;
@@ -592,8 +591,7 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->atapi_dma = 1;
-       hwif->mwdma_mask = 0x04;
+       hwif->mwdma_mask = ATA_MWDMA2_ONLY;
 
        hwif->dma_setup = &sgiioc4_ide_dma_setup;
        hwif->dma_start = &sgiioc4_ide_dma_start;
@@ -615,6 +613,7 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
        void __iomem *virt_base;
        ide_hwif_t *hwif;
        int h;
+       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
        /*
         * Find an empty HWIF; if none available, return -ENOMEM.
@@ -655,10 +654,12 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
        }
 
        if (hwif->io_ports[IDE_DATA_OFFSET] != cmd_base) {
+               hw_regs_t hw;
+
                /* Initialize the IO registers */
-               sgiioc4_init_hwif_ports(&hwif->hw, cmd_base, ctl, irqport);
-               memcpy(hwif->io_ports, hwif->hw.io_ports,
-                      sizeof (hwif->io_ports));
+               memset(&hw, 0, sizeof(hw));
+               sgiioc4_init_hwif_ports(&hw, cmd_base, ctl, irqport);
+               memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
                hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
        }
 
@@ -680,11 +681,10 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
 
        ide_init_sgiioc4(hwif);
 
-       if (probe_hwif_init(hwif))
-               return -EIO;
+       idx[0] = hwif->index;
 
-       /* Create /proc/ide entries */
-       ide_proc_register_port(hwif);
+       if (ide_device_add(idx))
+               return -EIO;
 
        return 0;
 }
@@ -692,14 +692,12 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
 static unsigned int __devinit
 pci_init_sgiioc4(struct pci_dev *dev)
 {
-       unsigned int class_rev;
        int ret;
 
-       pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
-       class_rev &= 0xff;
        printk(KERN_INFO "%s: IDE controller at PCI slot %s, revision %d\n",
-                        DRV_NAME, pci_name(dev), class_rev);
-       if (class_rev < IOC4_SUPPORTED_FIRMWARE_REV) {
+                        DRV_NAME, pci_name(dev), dev->revision);
+
+       if (dev->revision < IOC4_SUPPORTED_FIRMWARE_REV) {
                printk(KERN_ERR "Skipping %s IDE controller in slot %s: "
                                "firmware is obsolete - please upgrade to "
                                "revision46 or higher\n",