diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-07-24 12:46:42 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-08-03 03:04:14 -0400 |
commit | b5cb259e7fac5536c4ddf350af6a3d6cc950e47e (patch) | |
tree | fd752edd9a19ad9592fdabc87465ba17019465f6 /drivers/net | |
parent | a3d0d4d8dd45779b6e174a8567ffb9b485e472af (diff) |
pcmcia: remove memreq_t
Page already had to be set to 0; Offset can easily be passed as
parameter to pcmcia_map_mem_page.
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: linux-bluetooth@vger.kernel.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
CC: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 10 | ||||
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 11 | ||||
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 14 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 9 | ||||
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/airo_cs.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/b43/pcmcia.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/ray_cs.c | 13 |
8 files changed, 19 insertions, 54 deletions
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 699304480aed..98fffb03ecd7 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -545,7 +545,6 @@ failed: | |||
545 | static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | 545 | static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) |
546 | { | 546 | { |
547 | win_req_t req; | 547 | win_req_t req; |
548 | memreq_t mem; | ||
549 | u_char __iomem *base; | 548 | u_char __iomem *base; |
550 | int i, j; | 549 | int i, j; |
551 | 550 | ||
@@ -558,9 +557,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
558 | return -1; | 557 | return -1; |
559 | 558 | ||
560 | base = ioremap(req.Base, req.Size); | 559 | base = ioremap(req.Base, req.Size); |
561 | mem.Page = 0; | 560 | pcmcia_map_mem_page(link, link->win, 0); |
562 | mem.CardOffset = 0; | ||
563 | pcmcia_map_mem_page(link, link->win, &mem); | ||
564 | 561 | ||
565 | /* | 562 | /* |
566 | * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format | 563 | * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format |
@@ -594,7 +591,6 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
594 | static int fmvj18x_setup_mfc(struct pcmcia_device *link) | 591 | static int fmvj18x_setup_mfc(struct pcmcia_device *link) |
595 | { | 592 | { |
596 | win_req_t req; | 593 | win_req_t req; |
597 | memreq_t mem; | ||
598 | int i; | 594 | int i; |
599 | struct net_device *dev = link->priv; | 595 | struct net_device *dev = link->priv; |
600 | unsigned int ioaddr; | 596 | unsigned int ioaddr; |
@@ -614,9 +610,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link) | |||
614 | return -1; | 610 | return -1; |
615 | } | 611 | } |
616 | 612 | ||
617 | mem.Page = 0; | 613 | i = pcmcia_map_mem_page(link, link->win, 0); |
618 | mem.CardOffset = 0; | ||
619 | i = pcmcia_map_mem_page(link, link->win, &mem); | ||
620 | if (i != 0) { | 614 | if (i != 0) { |
621 | iounmap(lp->base); | 615 | iounmap(lp->base); |
622 | lp->base = NULL; | 616 | lp->base = NULL; |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index 3fd859570db3..c0b3cdd49c6a 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -211,7 +211,6 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
211 | struct net_device *dev = info->dev; | 211 | struct net_device *dev = info->dev; |
212 | struct tok_info *ti = netdev_priv(dev); | 212 | struct tok_info *ti = netdev_priv(dev); |
213 | win_req_t req; | 213 | win_req_t req; |
214 | memreq_t mem; | ||
215 | int i, ret; | 214 | int i, ret; |
216 | 215 | ||
217 | dev_dbg(&link->dev, "ibmtr_config\n"); | 216 | dev_dbg(&link->dev, "ibmtr_config\n"); |
@@ -250,9 +249,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
250 | if (ret) | 249 | if (ret) |
251 | goto failed; | 250 | goto failed; |
252 | 251 | ||
253 | mem.CardOffset = mmiobase; | 252 | ret = pcmcia_map_mem_page(link, link->win, mmiobase); |
254 | mem.Page = 0; | ||
255 | ret = pcmcia_map_mem_page(link, link->win, &mem); | ||
256 | if (ret) | 253 | if (ret) |
257 | goto failed; | 254 | goto failed; |
258 | ti->mmio = ioremap(req.Base, req.Size); | 255 | ti->mmio = ioremap(req.Base, req.Size); |
@@ -267,13 +264,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
267 | if (ret) | 264 | if (ret) |
268 | goto failed; | 265 | goto failed; |
269 | 266 | ||
270 | mem.CardOffset = srambase; | 267 | ret = pcmcia_map_mem_page(link, info->sram_win_handle, srambase); |
271 | mem.Page = 0; | ||
272 | ret = pcmcia_map_mem_page(link, info->sram_win_handle, &mem); | ||
273 | if (ret) | 268 | if (ret) |
274 | goto failed; | 269 | goto failed; |
275 | 270 | ||
276 | ti->sram_base = mem.CardOffset >> 12; | 271 | ti->sram_base = srambase >> 12; |
277 | ti->sram_virt = ioremap(req.Base, req.Size); | 272 | ti->sram_virt = ioremap(req.Base, req.Size); |
278 | ti->sram_phys = req.Base; | 273 | ti->sram_phys = req.Base; |
279 | 274 | ||
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 9c5fc9dfc55d..c3edfe4c2651 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -301,7 +301,6 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link) | |||
301 | { | 301 | { |
302 | struct net_device *dev = link->priv; | 302 | struct net_device *dev = link->priv; |
303 | win_req_t req; | 303 | win_req_t req; |
304 | memreq_t mem; | ||
305 | u_char __iomem *base, *virt; | 304 | u_char __iomem *base, *virt; |
306 | int i, j; | 305 | int i, j; |
307 | 306 | ||
@@ -314,10 +313,8 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link) | |||
314 | return NULL; | 313 | return NULL; |
315 | 314 | ||
316 | virt = ioremap(req.Base, req.Size); | 315 | virt = ioremap(req.Base, req.Size); |
317 | mem.Page = 0; | ||
318 | for (i = 0; i < NR_INFO; i++) { | 316 | for (i = 0; i < NR_INFO; i++) { |
319 | mem.CardOffset = hw_info[i].offset & ~(req.Size-1); | 317 | pcmcia_map_mem_page(link, link->win, hw_info[i].offset & ~(req.Size-1)); |
320 | pcmcia_map_mem_page(link, link->win, &mem); | ||
321 | base = &virt[hw_info[i].offset & (req.Size-1)]; | 318 | base = &virt[hw_info[i].offset & (req.Size-1)]; |
322 | if ((readb(base+0) == hw_info[i].a0) && | 319 | if ((readb(base+0) == hw_info[i].a0) && |
323 | (readb(base+2) == hw_info[i].a1) && | 320 | (readb(base+2) == hw_info[i].a1) && |
@@ -1463,7 +1460,6 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg, | |||
1463 | struct net_device *dev = link->priv; | 1460 | struct net_device *dev = link->priv; |
1464 | pcnet_dev_t *info = PRIV(dev); | 1461 | pcnet_dev_t *info = PRIV(dev); |
1465 | win_req_t req; | 1462 | win_req_t req; |
1466 | memreq_t mem; | ||
1467 | int i, window_size, offset, ret; | 1463 | int i, window_size, offset, ret; |
1468 | 1464 | ||
1469 | window_size = (stop_pg - start_pg) << 8; | 1465 | window_size = (stop_pg - start_pg) << 8; |
@@ -1482,11 +1478,9 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg, | |||
1482 | if (ret) | 1478 | if (ret) |
1483 | goto failed; | 1479 | goto failed; |
1484 | 1480 | ||
1485 | mem.CardOffset = (start_pg << 8) + cm_offset; | 1481 | offset = (start_pg << 8) + cm_offset; |
1486 | offset = mem.CardOffset % window_size; | 1482 | offset -= offset % window_size; |
1487 | mem.CardOffset -= offset; | 1483 | ret = pcmcia_map_mem_page(link, link->win, offset); |
1488 | mem.Page = 0; | ||
1489 | ret = pcmcia_map_mem_page(link, link->win, &mem); | ||
1490 | if (ret) | 1484 | if (ret) |
1491 | goto failed; | 1485 | goto failed; |
1492 | 1486 | ||
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index a5e47796f6ae..377367d03b41 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -443,7 +443,7 @@ static int mhz_mfc_config(struct pcmcia_device *link) | |||
443 | struct net_device *dev = link->priv; | 443 | struct net_device *dev = link->priv; |
444 | struct smc_private *smc = netdev_priv(dev); | 444 | struct smc_private *smc = netdev_priv(dev); |
445 | win_req_t req; | 445 | win_req_t req; |
446 | memreq_t mem; | 446 | unsigned int offset; |
447 | int i; | 447 | int i; |
448 | 448 | ||
449 | link->conf.Attributes |= CONF_ENABLE_SPKR; | 449 | link->conf.Attributes |= CONF_ENABLE_SPKR; |
@@ -467,11 +467,8 @@ static int mhz_mfc_config(struct pcmcia_device *link) | |||
467 | return -ENODEV; | 467 | return -ENODEV; |
468 | 468 | ||
469 | smc->base = ioremap(req.Base, req.Size); | 469 | smc->base = ioremap(req.Base, req.Size); |
470 | mem.CardOffset = mem.Page = 0; | 470 | offset = (smc->manfid == MANFID_MOTOROLA) ? link->conf.ConfigBase : 0; |
471 | if (smc->manfid == MANFID_MOTOROLA) | 471 | i = pcmcia_map_mem_page(link, link->win, offset); |
472 | mem.CardOffset = link->conf.ConfigBase; | ||
473 | i = pcmcia_map_mem_page(link, link->win, &mem); | ||
474 | |||
475 | if ((i == 0) && | 472 | if ((i == 0) && |
476 | (smc->manfid == MANFID_MEGAHERTZ) && | 473 | (smc->manfid == MANFID_MEGAHERTZ) && |
477 | (smc->cardid == PRODID_MEGAHERTZ_EM3288)) | 474 | (smc->cardid == PRODID_MEGAHERTZ_EM3288)) |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index 8fb0eb1dc341..4eb6f986703b 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -870,7 +870,6 @@ xirc2ps_config(struct pcmcia_device * link) | |||
870 | 870 | ||
871 | if (local->dingo) { | 871 | if (local->dingo) { |
872 | win_req_t req; | 872 | win_req_t req; |
873 | memreq_t mem; | ||
874 | 873 | ||
875 | /* Reset the modem's BAR to the correct value | 874 | /* Reset the modem's BAR to the correct value |
876 | * This is necessary because in the RequestConfiguration call, | 875 | * This is necessary because in the RequestConfiguration call, |
@@ -898,9 +897,7 @@ xirc2ps_config(struct pcmcia_device * link) | |||
898 | goto config_error; | 897 | goto config_error; |
899 | 898 | ||
900 | local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; | 899 | local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; |
901 | mem.CardOffset = 0x0; | 900 | if ((err = pcmcia_map_mem_page(link, link->win, 0))) |
902 | mem.Page = 0; | ||
903 | if ((err = pcmcia_map_mem_page(link, link->win, &mem))) | ||
904 | goto config_error; | 901 | goto config_error; |
905 | 902 | ||
906 | /* Setup the CCRs; there are no infos in the CIS about the Ethernet | 903 | /* Setup the CCRs; there are no infos in the CIS about the Ethernet |
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index d241b4aed71e..d47672cb4196 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c | |||
@@ -207,16 +207,14 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, | |||
207 | */ | 207 | */ |
208 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { | 208 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { |
209 | cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; | 209 | cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; |
210 | memreq_t map; | ||
211 | req->Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; | 210 | req->Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; |
212 | req->Base = mem->win[0].host_addr; | 211 | req->Base = mem->win[0].host_addr; |
213 | req->Size = mem->win[0].len; | 212 | req->Size = mem->win[0].len; |
214 | req->AccessSpeed = 0; | 213 | req->AccessSpeed = 0; |
215 | if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0) | 214 | if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0) |
216 | return -ENODEV; | 215 | return -ENODEV; |
217 | map.Page = 0; | 216 | if (pcmcia_map_mem_page(p_dev, p_dev->win, |
218 | map.CardOffset = mem->win[0].card_addr; | 217 | mem->win[0].card_addr) != 0) |
219 | if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0) | ||
220 | return -ENODEV; | 218 | return -ENODEV; |
221 | } | 219 | } |
222 | /* If we got this far, we're cool! */ | 220 | /* If we got this far, we're cool! */ |
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c index 7c9af82fcf7e..ffe1f89d5f72 100644 --- a/drivers/net/wireless/b43/pcmcia.c +++ b/drivers/net/wireless/b43/pcmcia.c | |||
@@ -64,7 +64,6 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
64 | { | 64 | { |
65 | struct ssb_bus *ssb; | 65 | struct ssb_bus *ssb; |
66 | win_req_t win; | 66 | win_req_t win; |
67 | memreq_t mem; | ||
68 | int err = -ENOMEM; | 67 | int err = -ENOMEM; |
69 | int res = 0; | 68 | int res = 0; |
70 | 69 | ||
@@ -87,9 +86,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
87 | if (res != 0) | 86 | if (res != 0) |
88 | goto err_kfree_ssb; | 87 | goto err_kfree_ssb; |
89 | 88 | ||
90 | mem.CardOffset = 0; | 89 | res = pcmcia_map_mem_page(dev, dev->win, 0); |
91 | mem.Page = 0; | ||
92 | res = pcmcia_map_mem_page(dev, dev->win, &mem); | ||
93 | if (res != 0) | 90 | if (res != 0) |
94 | goto err_disable; | 91 | goto err_disable; |
95 | 92 | ||
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index b83d5ef1dffe..7eb339af351b 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -393,7 +393,6 @@ static int ray_config(struct pcmcia_device *link) | |||
393 | int ret = 0; | 393 | int ret = 0; |
394 | int i; | 394 | int i; |
395 | win_req_t req; | 395 | win_req_t req; |
396 | memreq_t mem; | ||
397 | struct net_device *dev = (struct net_device *)link->priv; | 396 | struct net_device *dev = (struct net_device *)link->priv; |
398 | ray_dev_t *local = netdev_priv(dev); | 397 | ray_dev_t *local = netdev_priv(dev); |
399 | 398 | ||
@@ -430,9 +429,7 @@ static int ray_config(struct pcmcia_device *link) | |||
430 | ret = pcmcia_request_window(link, &req, &link->win); | 429 | ret = pcmcia_request_window(link, &req, &link->win); |
431 | if (ret) | 430 | if (ret) |
432 | goto failed; | 431 | goto failed; |
433 | mem.CardOffset = 0x0000; | 432 | ret = pcmcia_map_mem_page(link, link->win, 0); |
434 | mem.Page = 0; | ||
435 | ret = pcmcia_map_mem_page(link, link->win, &mem); | ||
436 | if (ret) | 433 | if (ret) |
437 | goto failed; | 434 | goto failed; |
438 | local->sram = ioremap(req.Base, req.Size); | 435 | local->sram = ioremap(req.Base, req.Size); |
@@ -446,9 +443,7 @@ static int ray_config(struct pcmcia_device *link) | |||
446 | ret = pcmcia_request_window(link, &req, &local->rmem_handle); | 443 | ret = pcmcia_request_window(link, &req, &local->rmem_handle); |
447 | if (ret) | 444 | if (ret) |
448 | goto failed; | 445 | goto failed; |
449 | mem.CardOffset = 0x8000; | 446 | ret = pcmcia_map_mem_page(link, local->rmem_handle, 0x8000); |
450 | mem.Page = 0; | ||
451 | ret = pcmcia_map_mem_page(link, local->rmem_handle, &mem); | ||
452 | if (ret) | 447 | if (ret) |
453 | goto failed; | 448 | goto failed; |
454 | local->rmem = ioremap(req.Base, req.Size); | 449 | local->rmem = ioremap(req.Base, req.Size); |
@@ -462,9 +457,7 @@ static int ray_config(struct pcmcia_device *link) | |||
462 | ret = pcmcia_request_window(link, &req, &local->amem_handle); | 457 | ret = pcmcia_request_window(link, &req, &local->amem_handle); |
463 | if (ret) | 458 | if (ret) |
464 | goto failed; | 459 | goto failed; |
465 | mem.CardOffset = 0x0000; | 460 | ret = pcmcia_map_mem_page(link, local->amem_handle, 0); |
466 | mem.Page = 0; | ||
467 | ret = pcmcia_map_mem_page(link, local->amem_handle, &mem); | ||
468 | if (ret) | 461 | if (ret) |
469 | goto failed; | 462 | goto failed; |
470 | local->amem = ioremap(req.Base, req.Size); | 463 | local->amem = ioremap(req.Base, req.Size); |