ide: cleanup ide_find_port()

Remove no longer needed matching against I/O base and 'base' argument.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent bad7c825
...@@ -41,7 +41,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq) ...@@ -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.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
hw.irq = irq; hw.irq = irq;
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); hwif = ide_find_port();
if (hwif == NULL) if (hwif == NULL)
goto out; goto out;
......
...@@ -400,7 +400,7 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e ...@@ -400,7 +400,7 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e
unsigned long port = (unsigned long)base + info->dataoffset; unsigned long port = (unsigned long)base + info->dataoffset;
ide_hwif_t *hwif; ide_hwif_t *hwif;
hwif = ide_find_port(port); hwif = ide_find_port();
if (hwif) { if (hwif) {
int i; int i;
......
...@@ -34,7 +34,7 @@ static int __init ide_arm_init(void) ...@@ -34,7 +34,7 @@ static int __init ide_arm_init(void)
ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206); ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
hw.irq = IDE_ARM_IRQ; hw.irq = IDE_ARM_IRQ;
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); hwif = ide_find_port();
if (hwif) { if (hwif) {
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
idx[0] = hwif->index; idx[0] = hwif->index;
......
...@@ -378,7 +378,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) ...@@ -378,7 +378,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
hw.irq = irq->start; hw.irq = irq->start;
hw.chipset = ide_palm3710; hw.chipset = ide_palm3710;
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); hwif = ide_find_port();
if (hwif == NULL) if (hwif == NULL)
goto out; goto out;
......
...@@ -44,7 +44,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -44,7 +44,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
goto release; goto release;
} }
hwif = ide_find_port((unsigned long)base); hwif = ide_find_port();
if (hwif) { if (hwif) {
memset(&hw, 0, sizeof(hw)); memset(&hw, 0, sizeof(hw));
rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq); rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq);
......
...@@ -804,7 +804,7 @@ static int __init init_e100_ide(void) ...@@ -804,7 +804,7 @@ static int __init init_e100_ide(void)
cris_setup_ports(&hw, cris_ide_base_address(h)); 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) if (hwif == NULL)
continue; continue;
ide_init_port_data(hwif, hwif->index); ide_init_port_data(hwif, hwif->index);
......
...@@ -99,8 +99,7 @@ static int __init h8300_ide_init(void) ...@@ -99,8 +99,7 @@ static int __init h8300_ide_init(void)
hw_setup(&hw); hw_setup(&hw);
/* register if */ hwif = ide_find_port();
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
if (hwif == NULL) { if (hwif == NULL) {
printk(KERN_ERR "ide-h8300: IDE I/F register failed\n"); printk(KERN_ERR "ide-h8300: IDE I/F register failed\n");
return -ENOENT; return -ENOENT;
......
...@@ -33,7 +33,7 @@ static ssize_t store_add(struct class *cls, const char *buf, size_t n) ...@@ -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) if (sscanf(buf, "%x:%x:%d", &base, &ctl, &irq) != 3)
return -EINVAL; return -EINVAL;
hwif = ide_find_port(base); hwif = ide_find_port();
if (hwif == NULL) if (hwif == NULL)
return -ENOENT; return -ENOENT;
......
...@@ -38,7 +38,7 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id ...@@ -38,7 +38,7 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id
pnp_port_start(dev, 1)); pnp_port_start(dev, 1));
hw.irq = pnp_irq(dev, 0); hw.irq = pnp_irq(dev, 0);
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); hwif = ide_find_port();
if (hwif) { if (hwif) {
u8 index = hwif->index; u8 index = hwif->index;
u8 idx[4] = { index, 0xff, 0xff, 0xff }; u8 idx[4] = { index, 0xff, 0xff, 0xff };
......
...@@ -232,28 +232,19 @@ static int ide_system_bus_speed(void) ...@@ -232,28 +232,19 @@ static int ide_system_bus_speed(void)
return pci_dev_present(pci_default) ? 33 : 50; 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; ide_hwif_t *hwif;
int i; 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++) { for (i = 0; i < MAX_HWIFS; i++) {
hwif = &ide_hwifs[i]; hwif = &ide_hwifs[i];
if (hwif->chipset == ide_unknown) if (hwif->chipset == ide_unknown)
goto found; return hwif;
} }
hwif = NULL; return NULL;
found:
return hwif;
} }
EXPORT_SYMBOL_GPL(ide_find_port); EXPORT_SYMBOL_GPL(ide_find_port);
static struct resource* hwif_request_region(ide_hwif_t *hwif, static struct resource* hwif_request_region(ide_hwif_t *hwif,
......
...@@ -221,7 +221,7 @@ static int __init buddha_init(void) ...@@ -221,7 +221,7 @@ static int __init buddha_init(void)
buddha_setup_ports(&hw, base, ctl, irq_port, ack_intr); 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) { if (hwif) {
u8 index = hwif->index; u8 index = hwif->index;
......
...@@ -76,7 +76,7 @@ static int __init falconide_init(void) ...@@ -76,7 +76,7 @@ static int __init falconide_init(void)
falconide_setup_ports(&hw); falconide_setup_ports(&hw);
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); hwif = ide_find_port();
if (hwif) { if (hwif) {
u8 index = hwif->index; u8 index = hwif->index;
u8 idx[4] = { index, 0xff, 0xff, 0xff }; u8 idx[4] = { index, 0xff, 0xff, 0xff };
......
...@@ -175,7 +175,7 @@ static int __init gayle_init(void) ...@@ -175,7 +175,7 @@ static int __init gayle_init(void)
gayle_setup_ports(&hw, base, ctrlport, irqport, ack_intr); gayle_setup_ports(&hw, base, ctrlport, irqport, ack_intr);
hwif = ide_find_port(base); hwif = ide_find_port();
if (hwif) { if (hwif) {
u8 index = hwif->index; u8 index = hwif->index;
......
...@@ -156,7 +156,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq ...@@ -156,7 +156,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
hw.chipset = ide_pci; hw.chipset = ide_pci;
hw.dev = &handle->dev; hw.dev = &handle->dev;
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); hwif = ide_find_port();
if (hwif == NULL) if (hwif == NULL)
return -1; return -1;
......
...@@ -89,7 +89,7 @@ static int __devinit plat_ide_probe(struct platform_device *pdev) ...@@ -89,7 +89,7 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
res_alt->start, res_alt->end - res_alt->start + 1); res_alt->start, res_alt->end - res_alt->start + 1);
} }
hwif = ide_find_port((unsigned long)base); hwif = ide_find_port();
if (!hwif) { if (!hwif) {
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
......
...@@ -120,7 +120,7 @@ static int __init macide_init(void) ...@@ -120,7 +120,7 @@ static int __init macide_init(void)
macide_setup_ports(&hw, base, irq, ack_intr); macide_setup_ports(&hw, base, irq, ack_intr);
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); hwif = ide_find_port();
if (hwif) { if (hwif) {
u8 index = hwif->index; u8 index = hwif->index;
u8 idx[4] = { index, 0xff, 0xff, 0xff }; u8 idx[4] = { index, 0xff, 0xff, 0xff };
......
...@@ -137,7 +137,7 @@ static int __init q40ide_init(void) ...@@ -137,7 +137,7 @@ static int __init q40ide_init(void)
// m68kide_iops, // m68kide_iops,
q40ide_default_irq(pcide_bases[i])); q40ide_default_irq(pcide_bases[i]));
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); hwif = ide_find_port();
if (hwif) { if (hwif) {
ide_init_port_data(hwif, hwif->index); ide_init_port_data(hwif, hwif->index);
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
......
...@@ -78,7 +78,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) ...@@ -78,7 +78,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
hw.irq = dev->irq; hw.irq = dev->irq;
hw.chipset = ide_pci; /* this enables IRQ sharing */ 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) if (hwif == NULL)
goto out_disable; goto out_disable;
......
...@@ -170,7 +170,7 @@ typedef struct hw_regs_s { ...@@ -170,7 +170,7 @@ typedef struct hw_regs_s {
struct device *dev; struct device *dev;
} hw_regs_t; } 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_data(struct hwif_s *, unsigned int);
void ide_init_port_hw(struct hwif_s *, hw_regs_t *); void ide_init_port_hw(struct hwif_s *, hw_regs_t *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment