diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-07-28 03:32:02 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-08-03 03:04:21 -0400 |
commit | 0f52e86ded65749c6037473013ad77b2afa4f68d (patch) | |
tree | ac5bb89a3d3187d5640e538a5aa9b414ea18a0c5 /drivers/net | |
parent | ad0c7be28bc7593da43f494f6d074767ea96ca59 (diff) |
pcmcia: do not request windows if you don't need to
Several drivers contained dummy code to request for memory windows,
even though they never made use of it. Remove all such code
snippets.
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/airo_cs.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index d47672cb4196..9a121a5b787c 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c | |||
@@ -154,8 +154,6 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, | |||
154 | unsigned int vcc, | 154 | unsigned int vcc, |
155 | void *priv_data) | 155 | void *priv_data) |
156 | { | 156 | { |
157 | win_req_t *req = priv_data; | ||
158 | |||
159 | if (cfg->index == 0) | 157 | if (cfg->index == 0) |
160 | return -ENODEV; | 158 | return -ENODEV; |
161 | 159 | ||
@@ -194,29 +192,6 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, | |||
194 | if (pcmcia_request_io(p_dev) != 0) | 192 | if (pcmcia_request_io(p_dev) != 0) |
195 | return -ENODEV; | 193 | return -ENODEV; |
196 | 194 | ||
197 | /* | ||
198 | Now set up a common memory window, if needed. There is room | ||
199 | in the struct pcmcia_device structure for one memory window handle, | ||
200 | but if the base addresses need to be saved, or if multiple | ||
201 | windows are needed, the info should go in the private data | ||
202 | structure for this device. | ||
203 | |||
204 | Note that the memory window base is a physical address, and | ||
205 | needs to be mapped to virtual space with ioremap() before it | ||
206 | is used. | ||
207 | */ | ||
208 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { | ||
209 | cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; | ||
210 | req->Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; | ||
211 | req->Base = mem->win[0].host_addr; | ||
212 | req->Size = mem->win[0].len; | ||
213 | req->AccessSpeed = 0; | ||
214 | if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0) | ||
215 | return -ENODEV; | ||
216 | if (pcmcia_map_mem_page(p_dev, p_dev->win, | ||
217 | mem->win[0].card_addr) != 0) | ||
218 | return -ENODEV; | ||
219 | } | ||
220 | /* If we got this far, we're cool! */ | 195 | /* If we got this far, we're cool! */ |
221 | return 0; | 196 | return 0; |
222 | } | 197 | } |
@@ -225,17 +200,12 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, | |||
225 | static int airo_config(struct pcmcia_device *link) | 200 | static int airo_config(struct pcmcia_device *link) |
226 | { | 201 | { |
227 | local_info_t *dev; | 202 | local_info_t *dev; |
228 | win_req_t *req; | ||
229 | int ret; | 203 | int ret; |
230 | 204 | ||
231 | dev = link->priv; | 205 | dev = link->priv; |
232 | 206 | ||
233 | dev_dbg(&link->dev, "airo_config\n"); | 207 | dev_dbg(&link->dev, "airo_config\n"); |
234 | 208 | ||
235 | req = kzalloc(sizeof(win_req_t), GFP_KERNEL); | ||
236 | if (!req) | ||
237 | return -ENOMEM; | ||
238 | |||
239 | /* | 209 | /* |
240 | * In this loop, we scan the CIS for configuration table | 210 | * In this loop, we scan the CIS for configuration table |
241 | * entries, each of which describes a valid card | 211 | * entries, each of which describes a valid card |
@@ -250,7 +220,7 @@ static int airo_config(struct pcmcia_device *link) | |||
250 | * and most client drivers will only use the CIS to fill in | 220 | * and most client drivers will only use the CIS to fill in |
251 | * implementation-defined details. | 221 | * implementation-defined details. |
252 | */ | 222 | */ |
253 | ret = pcmcia_loop_config(link, airo_cs_config_check, req); | 223 | ret = pcmcia_loop_config(link, airo_cs_config_check, NULL); |
254 | if (ret) | 224 | if (ret) |
255 | goto failed; | 225 | goto failed; |
256 | 226 | ||
@@ -281,16 +251,11 @@ static int airo_config(struct pcmcia_device *link) | |||
281 | printk(" & %pR", link->resource[0]); | 251 | printk(" & %pR", link->resource[0]); |
282 | if (link->resource[1]) | 252 | if (link->resource[1]) |
283 | printk(" & %pR", link->resource[1]); | 253 | printk(" & %pR", link->resource[1]); |
284 | if (link->win) | ||
285 | printk(", mem 0x%06lx-0x%06lx", req->Base, | ||
286 | req->Base+req->Size-1); | ||
287 | printk("\n"); | 254 | printk("\n"); |
288 | kfree(req); | ||
289 | return 0; | 255 | return 0; |
290 | 256 | ||
291 | failed: | 257 | failed: |
292 | airo_release(link); | 258 | airo_release(link); |
293 | kfree(req); | ||
294 | return -ENODEV; | 259 | return -ENODEV; |
295 | } /* airo_config */ | 260 | } /* airo_config */ |
296 | 261 | ||