ide: cleanup setting hwif->mmio flag
[cascardo/linux.git] / drivers / ide / mips / swarm.c
index 521edd4..112fe56 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));
@@ -115,9 +110,8 @@ static int __devinit swarm_ide_probe(struct device *dev)
 
        /* Setup MMIO ops.  */
        default_hwif_mmiops(hwif);
-       /* Prevent resource map manipulation.  */
-       hwif->mmio = 1;
-       hwif->noprobe = 0;
+
+       hwif->chipset = ide_generic;
 
        for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++)
                hwif->io_ports[i] =
@@ -128,7 +122,7 @@ static int __devinit swarm_ide_probe(struct device *dev)
 
        idx[0] = hwif->index;
 
-       ide_device_add(idx);
+       ide_device_add(idx, NULL);
 
        dev_set_drvdata(dev, hwif);