ide: cleanup setting hwif->mmio flag
[cascardo/linux.git] / drivers / ide / mips / swarm.c
index c2e2957..112fe56 100644 (file)
@@ -71,21 +71,17 @@ static int __devinit swarm_ide_probe(struct device *dev)
        u8 __iomem *base;
        phys_t offset, size;
        int i;
+       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
        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,23 +110,19 @@ 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->hw.io_ports[i] =
+               hwif->io_ports[i] =
                                (unsigned long)(base + ((0x1f0 + i) << 5));
-       hwif->hw.io_ports[IDE_CONTROL_OFFSET] =
+       hwif->io_ports[IDE_CONTROL_OFFSET] =
                                (unsigned long)(base + (0x3f6 << 5));
-       hwif->hw.irq = K_INT_GB_IDE;
-
-       memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
-       hwif->irq = hwif->hw.irq;
+       hwif->irq = K_INT_GB_IDE;
 
-       probe_hwif_init(hwif);
+       idx[0] = hwif->index;
 
-       ide_proc_register_port(hwif);
+       ide_device_add(idx, NULL);
 
        dev_set_drvdata(dev, hwif);