]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/mips/swarm.c
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / drivers / ide / mips / swarm.c
index 956259fc09ba079ced2db086cdf6fbf6a63fcab5..712d17bdd4705f8ff2d07bf20371c702de79a564 100644 (file)
@@ -76,17 +76,12 @@ static int __devinit swarm_ide_probe(struct device *dev)
        if (!SIBYTE_HAVE_IDE)
                return -ENODEV;
 
-       /* Find an empty slot.  */
-       for (i = 0; i < MAX_HWIFS; i++)
-               if (!ide_hwifs[i].io_ports[IDE_DATA_OFFSET])
-                       break;
-       if (i >= MAX_HWIFS) {
+       hwif = ide_find_port();
+       if (hwif == NULL) {
                printk(KERN_ERR DRV_NAME ": no free slot for interface\n");
                return -ENOMEM;
        }
 
-       hwif = ide_hwifs + i;
-
        base = ioremap(A_IO_EXT_BASE, 0x800);
        offset = __raw_readq(base + R_IO_EXT_REG(R_IO_EXT_START_ADDR, IDE_CS));
        size = __raw_readq(base + R_IO_EXT_REG(R_IO_EXT_MULT_SIZE, IDE_CS));
@@ -114,16 +109,15 @@ static int __devinit swarm_ide_probe(struct device *dev)
        base = ioremap(offset, size);
 
        /* Setup MMIO ops.  */
+       hwif->host_flags = IDE_HFLAG_MMIO;
        default_hwif_mmiops(hwif);
-       /* Prevent resource map manipulation.  */
-       hwif->mmio = 1;
+
        hwif->chipset = ide_generic;
-       hwif->noprobe = 0;
 
-       for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++)
-               hwif->io_ports[i] =
+       for (i = 0; i <= 7; i++)
+               hwif->io_ports_array[i] =
                                (unsigned long)(base + ((0x1f0 + i) << 5));
-       hwif->io_ports[IDE_CONTROL_OFFSET] =
+       hwif->io_ports.ctl_addr =
                                (unsigned long)(base + (0x3f6 << 5));
        hwif->irq = K_INT_GB_IDE;