ide: cleanup 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)
Remove no longer needed matching against I/O base and 'base' argument.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
19 files changed:
drivers/ide/arm/bast-ide.c
drivers/ide/arm/icside.c
drivers/ide/arm/ide_arm.c
drivers/ide/arm/palm_bk3710.c
drivers/ide/arm/rapide.c
drivers/ide/cris/ide-cris.c
drivers/ide/h8300/ide-h8300.c
drivers/ide/ide-generic.c
drivers/ide/ide-pnp.c
drivers/ide/ide.c
drivers/ide/legacy/buddha.c
drivers/ide/legacy/falconide.c
drivers/ide/legacy/gayle.c
drivers/ide/legacy/ide-cs.c
drivers/ide/legacy/ide_platform.c
drivers/ide/legacy/macide.c
drivers/ide/legacy/q40ide.c
drivers/ide/pci/delkin_cb.c
include/linux/ide.h

index ec46c44..3bd2c6d 100644 (file)
@@ -41,7 +41,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
        hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
        hw.irq = irq;
 
-       hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       hwif = ide_find_port();
        if (hwif == NULL)
                goto out;
 
index e816b0f..fd12bbe 100644 (file)
@@ -400,7 +400,7 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e
        unsigned long port = (unsigned long)base + info->dataoffset;
        ide_hwif_t *hwif;
 
-       hwif = ide_find_port(port);
+       hwif = ide_find_port();
        if (hwif) {
                int i;
 
index be9ff73..82643df 100644 (file)
@@ -34,7 +34,7 @@ static int __init ide_arm_init(void)
        ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
        hw.irq = IDE_ARM_IRQ;
 
-       hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       hwif = ide_find_port();
        if (hwif) {
                ide_init_port_hw(hwif, &hw);
                idx[0] = hwif->index;
index 420fcb7..caa4194 100644 (file)
@@ -378,7 +378,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
        hw.irq = irq->start;
        hw.chipset = ide_palm3710;
 
-       hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       hwif = ide_find_port();
        if (hwif == NULL)
                goto out;
 
index b30adcf..2c3d0ec 100644 (file)
@@ -44,7 +44,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
                goto release;
        }
 
-       hwif = ide_find_port((unsigned long)base);
+       hwif = ide_find_port();
        if (hwif) {
                memset(&hw, 0, sizeof(hw));
                rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq);
index 31266d2..790a775 100644 (file)
@@ -804,7 +804,7 @@ static int __init init_e100_ide(void)
 
                cris_setup_ports(&hw, cris_ide_base_address(h));
 
-               hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+               hwif = ide_find_port();
                if (hwif == NULL)
                        continue;
                ide_init_port_data(hwif, hwif->index);
index 4108ec4..92b02b9 100644 (file)
@@ -99,8 +99,7 @@ static int __init h8300_ide_init(void)
 
        hw_setup(&hw);
 
-       /* register if */
-       hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       hwif = ide_find_port();
        if (hwif == NULL) {
                printk(KERN_ERR "ide-h8300: IDE I/F register failed\n");
                return -ENOENT;
index 25fda0a..f3ec02e 100644 (file)
@@ -33,7 +33,7 @@ static ssize_t store_add(struct class *cls, const char *buf, size_t n)
        if (sscanf(buf, "%x:%x:%d", &base, &ctl, &irq) != 3)
                return -EINVAL;
 
-       hwif = ide_find_port(base);
+       hwif = ide_find_port();
        if (hwif == NULL)
                return -ENOENT;
 
index 34c2ad3..efc1936 100644 (file)
@@ -38,7 +38,7 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id
                                pnp_port_start(dev, 1));
        hw.irq = pnp_irq(dev, 0);
 
-       hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       hwif = ide_find_port();
        if (hwif) {
                u8 index = hwif->index;
                u8 idx[4] = { index, 0xff, 0xff, 0xff };
index 917c72d..4ca5111 100644 (file)
@@ -232,28 +232,19 @@ static int ide_system_bus_speed(void)
        return pci_dev_present(pci_default) ? 33 : 50;
 }
 
-ide_hwif_t * ide_find_port(unsigned long base)
+ide_hwif_t *ide_find_port(void)
 {
        ide_hwif_t *hwif;
        int i;
 
        for (i = 0; i < MAX_HWIFS; i++) {
                hwif = &ide_hwifs[i];
-               if (hwif->io_ports[IDE_DATA_OFFSET] == base)
-                       goto found;
-       }
-
-       for (i = 0; i < MAX_HWIFS; i++) {
-               hwif = &ide_hwifs[i];
                if (hwif->chipset == ide_unknown)
-                       goto found;
+                       return hwif;
        }
 
-       hwif = NULL;
-found:
-       return hwif;
+       return NULL;
 }
-
 EXPORT_SYMBOL_GPL(ide_find_port);
 
 static struct resource* hwif_request_region(ide_hwif_t *hwif,
index fdd3791..6956eb8 100644 (file)
@@ -221,7 +221,7 @@ fail_base2:
 
                        buddha_setup_ports(&hw, base, ctl, irq_port, ack_intr);
 
-                       hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+                       hwif = ide_find_port();
                        if (hwif) {
                                u8 index = hwif->index;
 
index e950afa..b88a3c1 100644 (file)
@@ -76,7 +76,7 @@ static int __init falconide_init(void)
 
        falconide_setup_ports(&hw);
 
-       hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       hwif = ide_find_port();
        if (hwif) {
                u8 index = hwif->index;
                u8 idx[4] = { index, 0xff, 0xff, 0xff };
index e3b4638..fcc8d52 100644 (file)
@@ -175,7 +175,7 @@ found:
 
        gayle_setup_ports(&hw, base, ctrlport, irqport, ack_intr);
 
-       hwif = ide_find_port(base);
+       hwif = ide_find_port();
        if (hwif) {
            u8 index = hwif->index;
 
index 9a23b94..b97b8d5 100644 (file)
@@ -156,7 +156,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
     hw.chipset = ide_pci;
     hw.dev = &handle->dev;
 
-    hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+    hwif = ide_find_port();
     if (hwif == NULL)
        return -1;
 
index 361b1bb..ffa57c1 100644 (file)
@@ -89,7 +89,7 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
                        res_alt->start, res_alt->end - res_alt->start + 1);
        }
 
-       hwif = ide_find_port((unsigned long)base);
+       hwif = ide_find_port();
        if (!hwif) {
                ret = -ENODEV;
                goto out;
index eaf5dbe..7429b80 100644 (file)
@@ -120,7 +120,7 @@ static int __init macide_init(void)
 
        macide_setup_ports(&hw, base, irq, ack_intr);
 
-       hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       hwif = ide_find_port();
        if (hwif) {
                u8 index = hwif->index;
                u8 idx[4] = { index, 0xff, 0xff, 0xff };
index 2da2875..fcbff0e 100644 (file)
@@ -137,7 +137,7 @@ static int __init q40ide_init(void)
 //                     m68kide_iops,
                        q40ide_default_irq(pcide_bases[i]));
 
-       hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       hwif = ide_find_port();
        if (hwif) {
                ide_init_port_data(hwif, hwif->index);
                ide_init_port_hw(hwif, &hw);
index 961698d..53857f8 100644 (file)
@@ -78,7 +78,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
        hw.irq = dev->irq;
        hw.chipset = ide_pci;           /* this enables IRQ sharing */
 
-       hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       hwif = ide_find_port();
        if (hwif == NULL)
                goto out_disable;
 
index 5f3e82a..c5728dd 100644 (file)
@@ -170,7 +170,7 @@ typedef struct hw_regs_s {
        struct device   *dev;
 } hw_regs_t;
 
-struct hwif_s * ide_find_port(unsigned long);
+struct hwif_s *ide_find_port(void);
 void ide_init_port_data(struct hwif_s *, unsigned int);
 void ide_init_port_hw(struct hwif_s *, hw_regs_t *);