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/staging | |
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/staging')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_daq_700.c | 23 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_daq_dio24.c | 24 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_labpc_cs.c | 24 |
3 files changed, 3 insertions, 68 deletions
diff --git a/drivers/staging/comedi/drivers/ni_daq_700.c b/drivers/staging/comedi/drivers/ni_daq_700.c index abaa40b8be7..bf2e84aa03e 100644 --- a/drivers/staging/comedi/drivers/ni_daq_700.c +++ b/drivers/staging/comedi/drivers/ni_daq_700.c | |||
@@ -555,8 +555,6 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
555 | unsigned int vcc, | 555 | unsigned int vcc, |
556 | void *priv_data) | 556 | void *priv_data) |
557 | { | 557 | { |
558 | win_req_t *req = priv_data; | ||
559 | |||
560 | if (cfg->index == 0) | 558 | if (cfg->index == 0) |
561 | return -ENODEV; | 559 | return -ENODEV; |
562 | 560 | ||
@@ -589,22 +587,6 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
589 | return -ENODEV; | 587 | return -ENODEV; |
590 | } | 588 | } |
591 | 589 | ||
592 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { | ||
593 | cistpl_mem_t *mem = | ||
594 | (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; | ||
595 | req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM; | ||
596 | req->Attributes |= WIN_ENABLE; | ||
597 | req->Base = mem->win[0].host_addr; | ||
598 | req->Size = mem->win[0].len; | ||
599 | if (req->Size < 0x1000) | ||
600 | req->Size = 0x1000; | ||
601 | req->AccessSpeed = 0; | ||
602 | if (pcmcia_request_window(p_dev, req, &p_dev->win)) | ||
603 | return -ENODEV; | ||
604 | if (pcmcia_map_mem_page(p_dev, p_dev->win, | ||
605 | mem->win[0].card_addr)) | ||
606 | return -ENODEV; | ||
607 | } | ||
608 | /* If we got this far, we're cool! */ | 590 | /* If we got this far, we're cool! */ |
609 | return 0; | 591 | return 0; |
610 | } | 592 | } |
@@ -618,7 +600,7 @@ static void dio700_config(struct pcmcia_device *link) | |||
618 | 600 | ||
619 | dev_dbg(&link->dev, "dio700_config\n"); | 601 | dev_dbg(&link->dev, "dio700_config\n"); |
620 | 602 | ||
621 | ret = pcmcia_loop_config(link, dio700_pcmcia_config_loop, &req); | 603 | ret = pcmcia_loop_config(link, dio700_pcmcia_config_loop, NULL); |
622 | if (ret) { | 604 | if (ret) { |
623 | dev_warn(&link->dev, "no configuration found\n"); | 605 | dev_warn(&link->dev, "no configuration found\n"); |
624 | goto failed; | 606 | goto failed; |
@@ -644,9 +626,6 @@ static void dio700_config(struct pcmcia_device *link) | |||
644 | printk(", io %pR", link->resource[0]); | 626 | printk(", io %pR", link->resource[0]); |
645 | if (link->resource[1]) | 627 | if (link->resource[1]) |
646 | printk(" & %pR", link->resource[1]); | 628 | printk(" & %pR", link->resource[1]); |
647 | if (link->win) | ||
648 | printk(", mem 0x%06lx-0x%06lx", req.Base, | ||
649 | req.Base + req.Size - 1); | ||
650 | printk("\n"); | 629 | printk("\n"); |
651 | 630 | ||
652 | return; | 631 | return; |
diff --git a/drivers/staging/comedi/drivers/ni_daq_dio24.c b/drivers/staging/comedi/drivers/ni_daq_dio24.c index caccece2085..9112e70cc85 100644 --- a/drivers/staging/comedi/drivers/ni_daq_dio24.c +++ b/drivers/staging/comedi/drivers/ni_daq_dio24.c | |||
@@ -307,8 +307,6 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
307 | unsigned int vcc, | 307 | unsigned int vcc, |
308 | void *priv_data) | 308 | void *priv_data) |
309 | { | 309 | { |
310 | win_req_t *req = priv_data; | ||
311 | |||
312 | if (cfg->index == 0) | 310 | if (cfg->index == 0) |
313 | return -ENODEV; | 311 | return -ENODEV; |
314 | 312 | ||
@@ -341,22 +339,6 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
341 | return -ENODEV; | 339 | return -ENODEV; |
342 | } | 340 | } |
343 | 341 | ||
344 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { | ||
345 | cistpl_mem_t *mem = | ||
346 | (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; | ||
347 | req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM; | ||
348 | req->Attributes |= WIN_ENABLE; | ||
349 | req->Base = mem->win[0].host_addr; | ||
350 | req->Size = mem->win[0].len; | ||
351 | if (req->Size < 0x1000) | ||
352 | req->Size = 0x1000; | ||
353 | req->AccessSpeed = 0; | ||
354 | if (pcmcia_request_window(p_dev, req, &p_dev->win)) | ||
355 | return -ENODEV; | ||
356 | if (pcmcia_map_mem_page(p_dev, p_dev->win, | ||
357 | mem->win[0].card_addr)) | ||
358 | return -ENODEV; | ||
359 | } | ||
360 | /* If we got this far, we're cool! */ | 342 | /* If we got this far, we're cool! */ |
361 | return 0; | 343 | return 0; |
362 | } | 344 | } |
@@ -364,13 +346,12 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
364 | static void dio24_config(struct pcmcia_device *link) | 346 | static void dio24_config(struct pcmcia_device *link) |
365 | { | 347 | { |
366 | int ret; | 348 | int ret; |
367 | win_req_t req; | ||
368 | 349 | ||
369 | printk(KERN_INFO "ni_daq_dio24: HOLA SOY YO! - config\n"); | 350 | printk(KERN_INFO "ni_daq_dio24: HOLA SOY YO! - config\n"); |
370 | 351 | ||
371 | dev_dbg(&link->dev, "dio24_config\n"); | 352 | dev_dbg(&link->dev, "dio24_config\n"); |
372 | 353 | ||
373 | ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop, &req); | 354 | ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop, NULL); |
374 | if (ret) { | 355 | if (ret) { |
375 | dev_warn(&link->dev, "no configuration found\n"); | 356 | dev_warn(&link->dev, "no configuration found\n"); |
376 | goto failed; | 357 | goto failed; |
@@ -396,9 +377,6 @@ static void dio24_config(struct pcmcia_device *link) | |||
396 | printk(" & %pR", link->resource[0]); | 377 | printk(" & %pR", link->resource[0]); |
397 | if (link->resource[1]) | 378 | if (link->resource[1]) |
398 | printk(" & %pR", link->resource[1]); | 379 | printk(" & %pR", link->resource[1]); |
399 | if (link->win) | ||
400 | printk(", mem 0x%06lx-0x%06lx", req.Base, | ||
401 | req.Base + req.Size - 1); | ||
402 | printk("\n"); | 380 | printk("\n"); |
403 | 381 | ||
404 | return; | 382 | return; |
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c index 94d9f7fe6f2..f204961e078 100644 --- a/drivers/staging/comedi/drivers/ni_labpc_cs.c +++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c | |||
@@ -285,8 +285,6 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
285 | unsigned int vcc, | 285 | unsigned int vcc, |
286 | void *priv_data) | 286 | void *priv_data) |
287 | { | 287 | { |
288 | win_req_t *req = priv_data; | ||
289 | |||
290 | if (cfg->index == 0) | 288 | if (cfg->index == 0) |
291 | return -ENODEV; | 289 | return -ENODEV; |
292 | 290 | ||
@@ -319,22 +317,6 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
319 | return -ENODEV; | 317 | return -ENODEV; |
320 | } | 318 | } |
321 | 319 | ||
322 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { | ||
323 | cistpl_mem_t *mem = | ||
324 | (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; | ||
325 | req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM; | ||
326 | req->Attributes |= WIN_ENABLE; | ||
327 | req->Base = mem->win[0].host_addr; | ||
328 | req->Size = mem->win[0].len; | ||
329 | if (req->Size < 0x1000) | ||
330 | req->Size = 0x1000; | ||
331 | req->AccessSpeed = 0; | ||
332 | if (pcmcia_request_window(p_dev, req, &p_dev->win)) | ||
333 | return -ENODEV; | ||
334 | if (pcmcia_map_mem_page(p_dev, p_dev->win, | ||
335 | mem->win[0].card_addr)) | ||
336 | return -ENODEV; | ||
337 | } | ||
338 | /* If we got this far, we're cool! */ | 320 | /* If we got this far, we're cool! */ |
339 | return 0; | 321 | return 0; |
340 | } | 322 | } |
@@ -343,11 +325,10 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
343 | static void labpc_config(struct pcmcia_device *link) | 325 | static void labpc_config(struct pcmcia_device *link) |
344 | { | 326 | { |
345 | int ret; | 327 | int ret; |
346 | win_req_t req; | ||
347 | 328 | ||
348 | dev_dbg(&link->dev, "labpc_config\n"); | 329 | dev_dbg(&link->dev, "labpc_config\n"); |
349 | 330 | ||
350 | ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, &req); | 331 | ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, NULL); |
351 | if (ret) { | 332 | if (ret) { |
352 | dev_warn(&link->dev, "no configuration found\n"); | 333 | dev_warn(&link->dev, "no configuration found\n"); |
353 | goto failed; | 334 | goto failed; |
@@ -373,9 +354,6 @@ static void labpc_config(struct pcmcia_device *link) | |||
373 | printk(" & %pR", link->resource[0]); | 354 | printk(" & %pR", link->resource[0]); |
374 | if (link->resource[1]) | 355 | if (link->resource[1]) |
375 | printk(" & %pR", link->resource[1]); | 356 | printk(" & %pR", link->resource[1]); |
376 | if (link->win) | ||
377 | printk(", mem 0x%06lx-0x%06lx", req.Base, | ||
378 | req.Base + req.Size - 1); | ||
379 | printk("\n"); | 357 | printk("\n"); |
380 | 358 | ||
381 | return; | 359 | return; |