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 | |
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>
-rw-r--r-- | drivers/char/pcmcia/ipwireless/main.c | 14 | ||||
-rw-r--r-- | drivers/isdn/hisax/sedlbauer_cs.c | 7 | ||||
-rw-r--r-- | drivers/mtd/maps/pcmciamtd.c | 13 | ||||
-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 | ||||
-rw-r--r-- | drivers/pcmcia/pcmcia_resource.c | 9 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/nsp_cs.c | 5 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_daq_700.c | 6 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_daq_dio24.c | 6 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_labpc_cs.c | 6 | ||||
-rw-r--r-- | include/pcmcia/cs.h | 6 | ||||
-rw-r--r-- | include/pcmcia/ds.h | 2 |
18 files changed, 42 insertions, 105 deletions
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c index 5f87b9f7b6d2..6c4aa4b0be99 100644 --- a/drivers/char/pcmcia/ipwireless/main.c +++ b/drivers/char/pcmcia/ipwireless/main.c | |||
@@ -84,8 +84,6 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, | |||
84 | { | 84 | { |
85 | struct ipw_dev *ipw = priv_data; | 85 | struct ipw_dev *ipw = priv_data; |
86 | struct resource *io_resource; | 86 | struct resource *io_resource; |
87 | memreq_t memreq_attr_memory; | ||
88 | memreq_t memreq_common_memory; | ||
89 | int ret; | 87 | int ret; |
90 | 88 | ||
91 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; | 89 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; |
@@ -121,11 +119,8 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, | |||
121 | if (ret != 0) | 119 | if (ret != 0) |
122 | goto exit1; | 120 | goto exit1; |
123 | 121 | ||
124 | memreq_common_memory.CardOffset = cfg->mem.win[0].card_addr; | ||
125 | memreq_common_memory.Page = 0; | ||
126 | |||
127 | ret = pcmcia_map_mem_page(p_dev, ipw->handle_common_memory, | 122 | ret = pcmcia_map_mem_page(p_dev, ipw->handle_common_memory, |
128 | &memreq_common_memory); | 123 | cfg->mem.win[0].card_addr); |
129 | 124 | ||
130 | if (ret != 0) | 125 | if (ret != 0) |
131 | goto exit2; | 126 | goto exit2; |
@@ -150,12 +145,7 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, | |||
150 | if (ret != 0) | 145 | if (ret != 0) |
151 | goto exit2; | 146 | goto exit2; |
152 | 147 | ||
153 | memreq_attr_memory.CardOffset = 0; | 148 | ret = pcmcia_map_mem_page(p_dev, ipw->handle_attr_memory, 0); |
154 | memreq_attr_memory.Page = 0; | ||
155 | |||
156 | ret = pcmcia_map_mem_page(p_dev, ipw->handle_attr_memory, | ||
157 | &memreq_attr_memory); | ||
158 | |||
159 | if (ret != 0) | 149 | if (ret != 0) |
160 | goto exit3; | 150 | goto exit3; |
161 | 151 | ||
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c index 4755eb440f7e..0b06dbb2d52d 100644 --- a/drivers/isdn/hisax/sedlbauer_cs.c +++ b/drivers/isdn/hisax/sedlbauer_cs.c | |||
@@ -232,7 +232,6 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev, | |||
232 | */ | 232 | */ |
233 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { | 233 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { |
234 | cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; | 234 | cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; |
235 | memreq_t map; | ||
236 | req->Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; | 235 | req->Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; |
237 | req->Attributes |= WIN_ENABLE; | 236 | req->Attributes |= WIN_ENABLE; |
238 | req->Base = mem->win[0].host_addr; | 237 | req->Base = mem->win[0].host_addr; |
@@ -240,9 +239,9 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev, | |||
240 | req->AccessSpeed = 0; | 239 | req->AccessSpeed = 0; |
241 | if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0) | 240 | if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0) |
242 | return -ENODEV; | 241 | return -ENODEV; |
243 | map.Page = 0; | 242 | |
244 | map.CardOffset = mem->win[0].card_addr; | 243 | if (pcmcia_map_mem_page(p_dev, p_dev->win, |
245 | if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0) | 244 | mem->win[0].card_addr) != 0) |
246 | return -ENODEV; | 245 | return -ENODEV; |
247 | } | 246 | } |
248 | return 0; | 247 | return 0; |
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index 79488164e432..f97463ecfc5e 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c | |||
@@ -102,7 +102,7 @@ static caddr_t remap_window(struct map_info *map, unsigned long to) | |||
102 | { | 102 | { |
103 | struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1; | 103 | struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1; |
104 | window_handle_t win = (window_handle_t)map->map_priv_2; | 104 | window_handle_t win = (window_handle_t)map->map_priv_2; |
105 | memreq_t mrq; | 105 | unsigned int offset; |
106 | int ret; | 106 | int ret; |
107 | 107 | ||
108 | if (!pcmcia_dev_present(dev->p_dev)) { | 108 | if (!pcmcia_dev_present(dev->p_dev)) { |
@@ -110,15 +110,14 @@ static caddr_t remap_window(struct map_info *map, unsigned long to) | |||
110 | return 0; | 110 | return 0; |
111 | } | 111 | } |
112 | 112 | ||
113 | mrq.CardOffset = to & ~(dev->win_size-1); | 113 | offset = to & ~(dev->win_size-1); |
114 | if(mrq.CardOffset != dev->offset) { | 114 | if (offset != dev->offset) { |
115 | DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x", | 115 | DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x", |
116 | dev->offset, mrq.CardOffset); | 116 | dev->offset, offset); |
117 | mrq.Page = 0; | 117 | ret = pcmcia_map_mem_page(dev->p_dev, win, offset); |
118 | ret = pcmcia_map_mem_page(dev->p_dev, win, &mrq); | ||
119 | if (ret != 0) | 118 | if (ret != 0) |
120 | return NULL; | 119 | return NULL; |
121 | dev->offset = mrq.CardOffset; | 120 | dev->offset = offset; |
122 | } | 121 | } |
123 | return dev->win_base + (to & (dev->win_size-1)); | 122 | return dev->win_base + (to & (dev->win_size-1)); |
124 | } | 123 | } |
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); |
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index a48d4a91d440..975baaa8168b 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c | |||
@@ -193,7 +193,7 @@ EXPORT_SYMBOL(pcmcia_write_config_byte); | |||
193 | 193 | ||
194 | 194 | ||
195 | int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh, | 195 | int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh, |
196 | memreq_t *req) | 196 | unsigned int offset) |
197 | { | 197 | { |
198 | struct pcmcia_socket *s = p_dev->socket; | 198 | struct pcmcia_socket *s = p_dev->socket; |
199 | int ret; | 199 | int ret; |
@@ -201,12 +201,9 @@ int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh, | |||
201 | wh--; | 201 | wh--; |
202 | if (wh >= MAX_WIN) | 202 | if (wh >= MAX_WIN) |
203 | return -EINVAL; | 203 | return -EINVAL; |
204 | if (req->Page != 0) { | 204 | |
205 | dev_dbg(&s->dev, "failure: requested page is zero\n"); | ||
206 | return -EINVAL; | ||
207 | } | ||
208 | mutex_lock(&s->ops_mutex); | 205 | mutex_lock(&s->ops_mutex); |
209 | s->win[wh].card_start = req->CardOffset; | 206 | s->win[wh].card_start = offset; |
210 | ret = s->ops->set_mem_map(s, &s->win[wh]); | 207 | ret = s->ops->set_mem_map(s, &s->win[wh]); |
211 | if (ret) | 208 | if (ret) |
212 | dev_warn(&s->dev, "failed to set_mem_map\n"); | 209 | dev_warn(&s->dev, "failed to set_mem_map\n"); |
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index 8bb598bb440d..dd9b40306f3d 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c | |||
@@ -1661,7 +1661,6 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev, | |||
1661 | } | 1661 | } |
1662 | 1662 | ||
1663 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { | 1663 | if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { |
1664 | memreq_t map; | ||
1665 | cistpl_mem_t *mem = | 1664 | cistpl_mem_t *mem = |
1666 | (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; | 1665 | (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; |
1667 | cfg_mem->req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; | 1666 | cfg_mem->req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; |
@@ -1673,8 +1672,8 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev, | |||
1673 | cfg_mem->req.AccessSpeed = 0; | 1672 | cfg_mem->req.AccessSpeed = 0; |
1674 | if (pcmcia_request_window(p_dev, &cfg_mem->req, &p_dev->win) != 0) | 1673 | if (pcmcia_request_window(p_dev, &cfg_mem->req, &p_dev->win) != 0) |
1675 | goto next_entry; | 1674 | goto next_entry; |
1676 | map.Page = 0; map.CardOffset = mem->win[0].card_addr; | 1675 | if (pcmcia_map_mem_page(p_dev, p_dev->win, |
1677 | if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0) | 1676 | mem->win[0].card_addr) != 0) |
1678 | goto next_entry; | 1677 | goto next_entry; |
1679 | 1678 | ||
1680 | cfg_mem->data->MmioAddress = (unsigned long) ioremap_nocache(cfg_mem->req.Base, cfg_mem->req.Size); | 1679 | cfg_mem->data->MmioAddress = (unsigned long) ioremap_nocache(cfg_mem->req.Base, cfg_mem->req.Size); |
diff --git a/drivers/staging/comedi/drivers/ni_daq_700.c b/drivers/staging/comedi/drivers/ni_daq_700.c index 7e41ad93703d..abaa40b8be7e 100644 --- a/drivers/staging/comedi/drivers/ni_daq_700.c +++ b/drivers/staging/comedi/drivers/ni_daq_700.c | |||
@@ -556,7 +556,6 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
556 | void *priv_data) | 556 | void *priv_data) |
557 | { | 557 | { |
558 | win_req_t *req = priv_data; | 558 | win_req_t *req = priv_data; |
559 | memreq_t map; | ||
560 | 559 | ||
561 | if (cfg->index == 0) | 560 | if (cfg->index == 0) |
562 | return -ENODEV; | 561 | return -ENODEV; |
@@ -602,9 +601,8 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
602 | req->AccessSpeed = 0; | 601 | req->AccessSpeed = 0; |
603 | if (pcmcia_request_window(p_dev, req, &p_dev->win)) | 602 | if (pcmcia_request_window(p_dev, req, &p_dev->win)) |
604 | return -ENODEV; | 603 | return -ENODEV; |
605 | map.Page = 0; | 604 | if (pcmcia_map_mem_page(p_dev, p_dev->win, |
606 | map.CardOffset = mem->win[0].card_addr; | 605 | mem->win[0].card_addr)) |
607 | if (pcmcia_map_mem_page(p_dev, p_dev->win, &map)) | ||
608 | return -ENODEV; | 606 | return -ENODEV; |
609 | } | 607 | } |
610 | /* If we got this far, we're cool! */ | 608 | /* If we got this far, we're cool! */ |
diff --git a/drivers/staging/comedi/drivers/ni_daq_dio24.c b/drivers/staging/comedi/drivers/ni_daq_dio24.c index b2483f86c242..caccece20855 100644 --- a/drivers/staging/comedi/drivers/ni_daq_dio24.c +++ b/drivers/staging/comedi/drivers/ni_daq_dio24.c | |||
@@ -308,7 +308,6 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
308 | void *priv_data) | 308 | void *priv_data) |
309 | { | 309 | { |
310 | win_req_t *req = priv_data; | 310 | win_req_t *req = priv_data; |
311 | memreq_t map; | ||
312 | 311 | ||
313 | if (cfg->index == 0) | 312 | if (cfg->index == 0) |
314 | return -ENODEV; | 313 | return -ENODEV; |
@@ -354,9 +353,8 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
354 | req->AccessSpeed = 0; | 353 | req->AccessSpeed = 0; |
355 | if (pcmcia_request_window(p_dev, req, &p_dev->win)) | 354 | if (pcmcia_request_window(p_dev, req, &p_dev->win)) |
356 | return -ENODEV; | 355 | return -ENODEV; |
357 | map.Page = 0; | 356 | if (pcmcia_map_mem_page(p_dev, p_dev->win, |
358 | map.CardOffset = mem->win[0].card_addr; | 357 | mem->win[0].card_addr)) |
359 | if (pcmcia_map_mem_page(p_dev, p_dev->win, &map)) | ||
360 | return -ENODEV; | 358 | return -ENODEV; |
361 | } | 359 | } |
362 | /* If we got this far, we're cool! */ | 360 | /* If we got this far, we're cool! */ |
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c index c1444b4a5b4c..94d9f7fe6f2c 100644 --- a/drivers/staging/comedi/drivers/ni_labpc_cs.c +++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c | |||
@@ -286,7 +286,6 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
286 | void *priv_data) | 286 | void *priv_data) |
287 | { | 287 | { |
288 | win_req_t *req = priv_data; | 288 | win_req_t *req = priv_data; |
289 | memreq_t map; | ||
290 | 289 | ||
291 | if (cfg->index == 0) | 290 | if (cfg->index == 0) |
292 | return -ENODEV; | 291 | return -ENODEV; |
@@ -332,9 +331,8 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
332 | req->AccessSpeed = 0; | 331 | req->AccessSpeed = 0; |
333 | if (pcmcia_request_window(p_dev, req, &p_dev->win)) | 332 | if (pcmcia_request_window(p_dev, req, &p_dev->win)) |
334 | return -ENODEV; | 333 | return -ENODEV; |
335 | map.Page = 0; | 334 | if (pcmcia_map_mem_page(p_dev, p_dev->win, |
336 | map.CardOffset = mem->win[0].card_addr; | 335 | mem->win[0].card_addr)) |
337 | if (pcmcia_map_mem_page(p_dev, p_dev->win, &map)) | ||
338 | return -ENODEV; | 336 | return -ENODEV; |
339 | } | 337 | } |
340 | /* If we got this far, we're cool! */ | 338 | /* If we got this far, we're cool! */ |
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 583a4e33039a..e4faf4420f2a 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h | |||
@@ -68,12 +68,6 @@ typedef struct config_req_t { | |||
68 | #define PRESENT_IOBASE_3 0x100 | 68 | #define PRESENT_IOBASE_3 0x100 |
69 | #define PRESENT_IOSIZE 0x200 | 69 | #define PRESENT_IOSIZE 0x200 |
70 | 70 | ||
71 | /* For GetMemPage, MapMemPage */ | ||
72 | typedef struct memreq_t { | ||
73 | u_int CardOffset; | ||
74 | u_short Page; | ||
75 | } memreq_t; | ||
76 | |||
77 | /* For RequestWindow */ | 71 | /* For RequestWindow */ |
78 | typedef struct win_req_t { | 72 | typedef struct win_req_t { |
79 | u_int Attributes; | 73 | u_int Attributes; |
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 0748bec0a87a..a2bf3a702c08 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
@@ -202,7 +202,7 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, | |||
202 | window_handle_t *wh); | 202 | window_handle_t *wh); |
203 | int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win); | 203 | int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win); |
204 | int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win, | 204 | int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win, |
205 | memreq_t *req); | 205 | unsigned int offset); |
206 | 206 | ||
207 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); | 207 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); |
208 | void pcmcia_disable_device(struct pcmcia_device *p_dev); | 208 | void pcmcia_disable_device(struct pcmcia_device *p_dev); |