Skip to content

Commit 59bff5b

Browse files
committed
ide: cleanup ide_find_port()
Remove no longer needed matching against I/O base and 'base' argument. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
1 parent bad7c82 commit 59bff5b

19 files changed

Lines changed: 21 additions & 31 deletions

File tree

‎drivers/ide/arm/bast-ide.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
4141
hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
4242
hw.irq = irq;
4343

44-
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
44+
hwif = ide_find_port();
4545
if (hwif == NULL)
4646
goto out;
4747

‎drivers/ide/arm/icside.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e
400400
unsigned long port = (unsigned long)base + info->dataoffset;
401401
ide_hwif_t *hwif;
402402

403-
hwif = ide_find_port(port);
403+
hwif = ide_find_port();
404404
if (hwif) {
405405
int i;
406406

‎drivers/ide/arm/ide_arm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static int __init ide_arm_init(void)
3434
ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
3535
hw.irq = IDE_ARM_IRQ;
3636

37-
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
37+
hwif = ide_find_port();
3838
if (hwif) {
3939
ide_init_port_hw(hwif, &hw);
4040
idx[0] = hwif->index;

‎drivers/ide/arm/palm_bk3710.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
378378
hw.irq = irq->start;
379379
hw.chipset = ide_palm3710;
380380

381-
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
381+
hwif = ide_find_port();
382382
if (hwif == NULL)
383383
goto out;
384384

‎drivers/ide/arm/rapide.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
4444
goto release;
4545
}
4646

47-
hwif = ide_find_port((unsigned long)base);
47+
hwif = ide_find_port();
4848
if (hwif) {
4949
memset(&hw, 0, sizeof(hw));
5050
rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq);

‎drivers/ide/cris/ide-cris.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ static int __init init_e100_ide(void)
804804

805805
cris_setup_ports(&hw, cris_ide_base_address(h));
806806

807-
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
807+
hwif = ide_find_port();
808808
if (hwif == NULL)
809809
continue;
810810
ide_init_port_data(hwif, hwif->index);

‎drivers/ide/h8300/ide-h8300.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ static int __init h8300_ide_init(void)
9999

100100
hw_setup(&hw);
101101

102-
/* register if */
103-
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
102+
hwif = ide_find_port();
104103
if (hwif == NULL) {
105104
printk(KERN_ERR "ide-h8300: IDE I/F register failed\n");
106105
return -ENOENT;

‎drivers/ide/ide-generic.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static ssize_t store_add(struct class *cls, const char *buf, size_t n)
3333
if (sscanf(buf, "%x:%x:%d", &base, &ctl, &irq) != 3)
3434
return -EINVAL;
3535

36-
hwif = ide_find_port(base);
36+
hwif = ide_find_port();
3737
if (hwif == NULL)
3838
return -ENOENT;
3939

‎drivers/ide/ide-pnp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id
3838
pnp_port_start(dev, 1));
3939
hw.irq = pnp_irq(dev, 0);
4040

41-
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
41+
hwif = ide_find_port();
4242
if (hwif) {
4343
u8 index = hwif->index;
4444
u8 idx[4] = { index, 0xff, 0xff, 0xff };

‎drivers/ide/ide.c‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -232,28 +232,19 @@ static int ide_system_bus_speed(void)
232232
return pci_dev_present(pci_default) ? 33 : 50;
233233
}
234234

235-
ide_hwif_t * ide_find_port(unsigned long base)
235+
ide_hwif_t *ide_find_port(void)
236236
{
237237
ide_hwif_t *hwif;
238238
int i;
239239

240-
for (i = 0; i < MAX_HWIFS; i++) {
241-
hwif = &ide_hwifs[i];
242-
if (hwif->io_ports[IDE_DATA_OFFSET] == base)
243-
goto found;
244-
}
245-
246240
for (i = 0; i < MAX_HWIFS; i++) {
247241
hwif = &ide_hwifs[i];
248242
if (hwif->chipset == ide_unknown)
249-
goto found;
243+
return hwif;
250244
}
251245

252-
hwif = NULL;
253-
found:
254-
return hwif;
246+
return NULL;
255247
}
256-
257248
EXPORT_SYMBOL_GPL(ide_find_port);
258249

259250
static struct resource* hwif_request_region(ide_hwif_t *hwif,

0 commit comments

Comments
 (0)