]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/arm/rapide.c
IB/ipath: Remove dead code for user process waiting for send buffer
[linux-2.6-omap-h63xx.git] / drivers / ide / arm / rapide.c
index 6d2fe21cd729009f1e1a4b42e93b20860f516ef7..0775a3afef4862d5e5b2b5646443cbcfdec1448c 100644 (file)
 
 #include <asm/ecard.h>
 
-/*
- * Something like this really should be in generic code, but isn't.
- */
 static ide_hwif_t *
 rapide_locate_hwif(void __iomem *base, void __iomem *ctrl, unsigned int sz, int irq)
 {
        unsigned long port = (unsigned long)base;
-       ide_hwif_t *hwif;
-       int index, i;
-
-       for (index = 0; index < MAX_HWIFS; ++index) {
-               hwif = ide_hwifs + index;
-               if (hwif->io_ports[IDE_DATA_OFFSET] == port)
-                       goto found;
-       }
+       ide_hwif_t *hwif = ide_find_port(port);
+       int i;
 
-       for (index = 0; index < MAX_HWIFS; ++index) {
-               hwif = ide_hwifs + index;
-               if (hwif->io_ports[IDE_DATA_OFFSET] == 0)
-                       goto found;
-       }
-
-       return NULL;
+       if (hwif == NULL)
+               goto out;
 
- found:
        for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
-               hwif->hw.io_ports[i] = port;
                hwif->io_ports[i] = port;
                port += sz;
        }
-       hwif->hw.io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
        hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
-       hwif->hw.irq = hwif->irq = irq;
+       hwif->irq = irq;
        hwif->mmio = 1;
        default_hwif_mmiops(hwif);
-
+out:
        return hwif;
 }