aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 11:36:32 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 11:36:32 -0400
commit59bff5ba5529feac3a0214d897b1920cbe4e2278 (patch)
treed849fb6c526077f96512b8253c924fba1ec5cb12
parentbad7c825cb27377faf1c926953aa15c980c62620 (diff)
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>
-rw-r--r--drivers/ide/arm/bast-ide.c2
-rw-r--r--drivers/ide/arm/icside.c2
-rw-r--r--drivers/ide/arm/ide_arm.c2
-rw-r--r--drivers/ide/arm/palm_bk3710.c2
-rw-r--r--drivers/ide/arm/rapide.c2
-rw-r--r--drivers/ide/cris/ide-cris.c2
-rw-r--r--drivers/ide/h8300/ide-h8300.c3
-rw-r--r--drivers/ide/ide-generic.c2
-rw-r--r--drivers/ide/ide-pnp.c2
-rw-r--r--drivers/ide/ide.c15
-rw-r--r--drivers/ide/legacy/buddha.c2
-rw-r--r--drivers/ide/legacy/falconide.c2
-rw-r--r--drivers/ide/legacy/gayle.c2
-rw-r--r--drivers/ide/legacy/ide-cs.c2
-rw-r--r--drivers/ide/legacy/ide_platform.c2
-rw-r--r--drivers/ide/legacy/macide.c2
-rw-r--r--drivers/ide/legacy/q40ide.c2
-rw-r--r--drivers/ide/pci/delkin_cb.c2
-rw-r--r--include/linux/ide.h2
19 files changed, 21 insertions, 31 deletions
diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c
index ec46c44b061c..3bd2c6dcd80b 100644
--- a/drivers/ide/arm/bast-ide.c
+++ b/drivers/ide/arm/bast-ide.c
@@ -41,7 +41,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
41 hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20); 41 hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
42 hw.irq = irq; 42 hw.irq = irq;
43 43
44 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 44 hwif = ide_find_port();
45 if (hwif == NULL) 45 if (hwif == NULL)
46 goto out; 46 goto out;
47 47
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index e816b0ffcfe6..fd12bbe93f11 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -400,7 +400,7 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e
400 unsigned long port = (unsigned long)base + info->dataoffset; 400 unsigned long port = (unsigned long)base + info->dataoffset;
401 ide_hwif_t *hwif; 401 ide_hwif_t *hwif;
402 402
403 hwif = ide_find_port(port); 403 hwif = ide_find_port();
404 if (hwif) { 404 if (hwif) {
405 int i; 405 int i;
406 406
diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c
index be9ff7334c52..82643df7c49a 100644
--- a/drivers/ide/arm/ide_arm.c
+++ b/drivers/ide/arm/ide_arm.c
@@ -34,7 +34,7 @@ static int __init ide_arm_init(void)
34 ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206); 34 ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
35 hw.irq = IDE_ARM_IRQ; 35 hw.irq = IDE_ARM_IRQ;
36 36
37 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 37 hwif = ide_find_port();
38 if (hwif) { 38 if (hwif) {
39 ide_init_port_hw(hwif, &hw); 39 ide_init_port_hw(hwif, &hw);
40 idx[0] = hwif->index; 40 idx[0] = hwif->index;
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index 420fcb78a7cd..caa419404daa 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -378,7 +378,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
378 hw.irq = irq->start; 378 hw.irq = irq->start;
379 hw.chipset = ide_palm3710; 379 hw.chipset = ide_palm3710;
380 380
381 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 381 hwif = ide_find_port();
382 if (hwif == NULL) 382 if (hwif == NULL)
383 goto out; 383 goto out;
384 384
diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c
index b30adcf321c3..2c3d0ec91dc3 100644
--- a/drivers/ide/arm/rapide.c
+++ b/drivers/ide/arm/rapide.c
@@ -44,7 +44,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
44 goto release; 44 goto release;
45 } 45 }
46 46
47 hwif = ide_find_port((unsigned long)base); 47 hwif = ide_find_port();
48 if (hwif) { 48 if (hwif) {
49 memset(&hw, 0, sizeof(hw)); 49 memset(&hw, 0, sizeof(hw));
50 rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq); 50 rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq);
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index 31266d278095..790a7759d455 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -804,7 +804,7 @@ static int __init init_e100_ide(void)
804 804
805 cris_setup_ports(&hw, cris_ide_base_address(h)); 805 cris_setup_ports(&hw, cris_ide_base_address(h));
806 806
807 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 807 hwif = ide_find_port();
808 if (hwif == NULL) 808 if (hwif == NULL)
809 continue; 809 continue;
810 ide_init_port_data(hwif, hwif->index); 810 ide_init_port_data(hwif, hwif->index);
diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c
index 4108ec4ffa7f..92b02b96d7db 100644
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -99,8 +99,7 @@ static int __init h8300_ide_init(void)
99 99
100 hw_setup(&hw); 100 hw_setup(&hw);
101 101
102 /* register if */ 102 hwif = ide_find_port();
103 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
104 if (hwif == NULL) { 103 if (hwif == NULL) {
105 printk(KERN_ERR "ide-h8300: IDE I/F register failed\n"); 104 printk(KERN_ERR "ide-h8300: IDE I/F register failed\n");
106 return -ENOENT; 105 return -ENOENT;
diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
index 25fda0a3263f..f3ec02ed4492 100644
--- a/drivers/ide/ide-generic.c
+++ b/drivers/ide/ide-generic.c
@@ -33,7 +33,7 @@ static ssize_t store_add(struct class *cls, const char *buf, size_t n)
33 if (sscanf(buf, "%x:%x:%d", &base, &ctl, &irq) != 3) 33 if (sscanf(buf, "%x:%x:%d", &base, &ctl, &irq) != 3)
34 return -EINVAL; 34 return -EINVAL;
35 35
36 hwif = ide_find_port(base); 36 hwif = ide_find_port();
37 if (hwif == NULL) 37 if (hwif == NULL)
38 return -ENOENT; 38 return -ENOENT;
39 39
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c
index 34c2ad36ce54..efc193602bf8 100644
--- a/drivers/ide/ide-pnp.c
+++ b/drivers/ide/ide-pnp.c
@@ -38,7 +38,7 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id
38 pnp_port_start(dev, 1)); 38 pnp_port_start(dev, 1));
39 hw.irq = pnp_irq(dev, 0); 39 hw.irq = pnp_irq(dev, 0);
40 40
41 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 41 hwif = ide_find_port();
42 if (hwif) { 42 if (hwif) {
43 u8 index = hwif->index; 43 u8 index = hwif->index;
44 u8 idx[4] = { index, 0xff, 0xff, 0xff }; 44 u8 idx[4] = { index, 0xff, 0xff, 0xff };
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 917c72dcd33d..4ca511156a11 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -232,28 +232,19 @@ static int ide_system_bus_speed(void)
232 return pci_dev_present(pci_default) ? 33 : 50; 232 return pci_dev_present(pci_default) ? 33 : 50;
233} 233}
234 234
235ide_hwif_t * ide_find_port(unsigned long base) 235ide_hwif_t *ide_find_port(void)
236{ 236{
237 ide_hwif_t *hwif; 237 ide_hwif_t *hwif;
238 int i; 238 int i;
239 239
240 for (i = 0; i < MAX_HWIFS; i++) { 240 for (i = 0; i < MAX_HWIFS; i++) {
241 hwif = &ide_hwifs[i]; 241 hwif = &ide_hwifs[i];
242 if (hwif->io_ports[IDE_DATA_OFFSET] == base)
243 goto found;
244 }
245
246 for (i = 0; i < MAX_HWIFS; i++) {
247 hwif = &ide_hwifs[i];
248 if (hwif->chipset == ide_unknown) 242 if (hwif->chipset == ide_unknown)
249 goto found; 243 return hwif;
250 } 244 }
251 245
252 hwif = NULL; 246 return NULL;
253found:
254 return hwif;
255} 247}
256
257EXPORT_SYMBOL_GPL(ide_find_port); 248EXPORT_SYMBOL_GPL(ide_find_port);
258 249
259static struct resource* hwif_request_region(ide_hwif_t *hwif, 250static struct resource* hwif_request_region(ide_hwif_t *hwif,
diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c
index fdd3791e465f..6956eb8f2d5f 100644
--- a/drivers/ide/legacy/buddha.c
+++ b/drivers/ide/legacy/buddha.c
@@ -221,7 +221,7 @@ fail_base2:
221 221
222 buddha_setup_ports(&hw, base, ctl, irq_port, ack_intr); 222 buddha_setup_ports(&hw, base, ctl, irq_port, ack_intr);
223 223
224 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 224 hwif = ide_find_port();
225 if (hwif) { 225 if (hwif) {
226 u8 index = hwif->index; 226 u8 index = hwif->index;
227 227
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c
index e950afa5939c..b88a3c192d84 100644
--- a/drivers/ide/legacy/falconide.c
+++ b/drivers/ide/legacy/falconide.c
@@ -76,7 +76,7 @@ static int __init falconide_init(void)
76 76
77 falconide_setup_ports(&hw); 77 falconide_setup_ports(&hw);
78 78
79 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 79 hwif = ide_find_port();
80 if (hwif) { 80 if (hwif) {
81 u8 index = hwif->index; 81 u8 index = hwif->index;
82 u8 idx[4] = { index, 0xff, 0xff, 0xff }; 82 u8 idx[4] = { index, 0xff, 0xff, 0xff };
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index e3b4638cc883..fcc8d52bf2a1 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -175,7 +175,7 @@ found:
175 175
176 gayle_setup_ports(&hw, base, ctrlport, irqport, ack_intr); 176 gayle_setup_ports(&hw, base, ctrlport, irqport, ack_intr);
177 177
178 hwif = ide_find_port(base); 178 hwif = ide_find_port();
179 if (hwif) { 179 if (hwif) {
180 u8 index = hwif->index; 180 u8 index = hwif->index;
181 181
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 9a23b94f2939..b97b8d51b3eb 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -156,7 +156,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
156 hw.chipset = ide_pci; 156 hw.chipset = ide_pci;
157 hw.dev = &handle->dev; 157 hw.dev = &handle->dev;
158 158
159 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 159 hwif = ide_find_port();
160 if (hwif == NULL) 160 if (hwif == NULL)
161 return -1; 161 return -1;
162 162
diff --git a/drivers/ide/legacy/ide_platform.c b/drivers/ide/legacy/ide_platform.c
index 361b1bb544bf..ffa57c1175d0 100644
--- a/drivers/ide/legacy/ide_platform.c
+++ b/drivers/ide/legacy/ide_platform.c
@@ -89,7 +89,7 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
89 res_alt->start, res_alt->end - res_alt->start + 1); 89 res_alt->start, res_alt->end - res_alt->start + 1);
90 } 90 }
91 91
92 hwif = ide_find_port((unsigned long)base); 92 hwif = ide_find_port();
93 if (!hwif) { 93 if (!hwif) {
94 ret = -ENODEV; 94 ret = -ENODEV;
95 goto out; 95 goto out;
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c
index eaf5dbe58bc2..7429b80cb089 100644
--- a/drivers/ide/legacy/macide.c
+++ b/drivers/ide/legacy/macide.c
@@ -120,7 +120,7 @@ static int __init macide_init(void)
120 120
121 macide_setup_ports(&hw, base, irq, ack_intr); 121 macide_setup_ports(&hw, base, irq, ack_intr);
122 122
123 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 123 hwif = ide_find_port();
124 if (hwif) { 124 if (hwif) {
125 u8 index = hwif->index; 125 u8 index = hwif->index;
126 u8 idx[4] = { index, 0xff, 0xff, 0xff }; 126 u8 idx[4] = { index, 0xff, 0xff, 0xff };
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c
index 2da28759686e..fcbff0eced1b 100644
--- a/drivers/ide/legacy/q40ide.c
+++ b/drivers/ide/legacy/q40ide.c
@@ -137,7 +137,7 @@ static int __init q40ide_init(void)
137// m68kide_iops, 137// m68kide_iops,
138 q40ide_default_irq(pcide_bases[i])); 138 q40ide_default_irq(pcide_bases[i]));
139 139
140 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 140 hwif = ide_find_port();
141 if (hwif) { 141 if (hwif) {
142 ide_init_port_data(hwif, hwif->index); 142 ide_init_port_data(hwif, hwif->index);
143 ide_init_port_hw(hwif, &hw); 143 ide_init_port_hw(hwif, &hw);
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c
index 961698d655eb..53857f809667 100644
--- a/drivers/ide/pci/delkin_cb.c
+++ b/drivers/ide/pci/delkin_cb.c
@@ -78,7 +78,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
78 hw.irq = dev->irq; 78 hw.irq = dev->irq;
79 hw.chipset = ide_pci; /* this enables IRQ sharing */ 79 hw.chipset = ide_pci; /* this enables IRQ sharing */
80 80
81 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 81 hwif = ide_find_port();
82 if (hwif == NULL) 82 if (hwif == NULL)
83 goto out_disable; 83 goto out_disable;
84 84
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 5f3e82ae901a..c5728dd5d9d9 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -170,7 +170,7 @@ typedef struct hw_regs_s {
170 struct device *dev; 170 struct device *dev;
171} hw_regs_t; 171} hw_regs_t;
172 172
173struct hwif_s * ide_find_port(unsigned long); 173struct hwif_s *ide_find_port(void);
174void ide_init_port_data(struct hwif_s *, unsigned int); 174void ide_init_port_data(struct hwif_s *, unsigned int);
175void ide_init_port_hw(struct hwif_s *, hw_regs_t *); 175void ide_init_port_hw(struct hwif_s *, hw_regs_t *);
176 176