]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
swarm: use ide_find_port()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 26 Apr 2008 15:36:32 +0000 (17:36 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 26 Apr 2008 15:36:32 +0000 (17:36 +0200)
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/mips/swarm.c

index 956259fc09ba079ced2db086cdf6fbf6a63fcab5..bbe8d585334891c5e5b40555aed1a6353648b78c 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));