pcmcia: Pass struct pcmcia_device to pcmcia_map_mem_page()

No logic changes, just pass struct pcmcia_device to pcmcia_map_mem_page()

[linux@dominikbrodowski.net: update to 2.6.31]
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-scsi@vger.kernel.org
CC: Jiri Kosina <jkosina@suse.cz>
Acked-by: Karsten Keil <keil@b1-systems.de> (for ISDN)
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
Magnus Damm 2006-12-13 19:46:43 +09:00 committed by Dominik Brodowski
parent f5560da549
commit 868575d1e8
19 changed files with 29 additions and 25 deletions

View File

@ -125,7 +125,7 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,
memreq_common_memory.CardOffset = cfg->mem.win[0].card_addr; memreq_common_memory.CardOffset = cfg->mem.win[0].card_addr;
memreq_common_memory.Page = 0; memreq_common_memory.Page = 0;
ret = pcmcia_map_mem_page(ipw->handle_common_memory, ret = pcmcia_map_mem_page(p_dev, ipw->handle_common_memory,
&memreq_common_memory); &memreq_common_memory);
if (ret != 0) if (ret != 0)
@ -154,7 +154,7 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,
memreq_attr_memory.CardOffset = 0; memreq_attr_memory.CardOffset = 0;
memreq_attr_memory.Page = 0; memreq_attr_memory.Page = 0;
ret = pcmcia_map_mem_page(ipw->handle_attr_memory, ret = pcmcia_map_mem_page(p_dev, ipw->handle_attr_memory,
&memreq_attr_memory); &memreq_attr_memory);
if (ret != 0) if (ret != 0)

View File

@ -276,7 +276,7 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
return -ENODEV; return -ENODEV;
map.Page = 0; map.Page = 0;
map.CardOffset = mem->win[0].card_addr; map.CardOffset = mem->win[0].card_addr;
if (pcmcia_map_mem_page(p_dev->win, &map) != 0) if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0)
return -ENODEV; return -ENODEV;
} }
return 0; return 0;

View File

@ -118,7 +118,7 @@ static caddr_t remap_window(struct map_info *map, unsigned long to)
DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x", DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x",
dev->offset, mrq.CardOffset); dev->offset, mrq.CardOffset);
mrq.Page = 0; mrq.Page = 0;
ret = pcmcia_map_mem_page(win, &mrq); ret = pcmcia_map_mem_page(dev->p_dev, win, &mrq);
if (ret != 0) if (ret != 0)
return NULL; return NULL;
dev->offset = mrq.CardOffset; dev->offset = mrq.CardOffset;

View File

@ -574,7 +574,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
base = ioremap(req.Base, req.Size); base = ioremap(req.Base, req.Size);
mem.Page = 0; mem.Page = 0;
mem.CardOffset = 0; mem.CardOffset = 0;
pcmcia_map_mem_page(link->win, &mem); pcmcia_map_mem_page(link, link->win, &mem);
/* /*
* MBH10304 CISTPL_FUNCE_LAN_NODE_ID format * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format
@ -630,7 +630,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link)
mem.Page = 0; mem.Page = 0;
mem.CardOffset = 0; mem.CardOffset = 0;
i = pcmcia_map_mem_page(link->win, &mem); i = pcmcia_map_mem_page(link, link->win, &mem);
if (i != 0) { if (i != 0) {
iounmap(lp->base); iounmap(lp->base);
lp->base = NULL; lp->base = NULL;

View File

@ -252,7 +252,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
mem.CardOffset = mmiobase; mem.CardOffset = mmiobase;
mem.Page = 0; mem.Page = 0;
ret = pcmcia_map_mem_page(link->win, &mem); ret = pcmcia_map_mem_page(link, link->win, &mem);
if (ret) if (ret)
goto failed; goto failed;
ti->mmio = ioremap(req.Base, req.Size); ti->mmio = ioremap(req.Base, req.Size);
@ -269,7 +269,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
mem.CardOffset = srambase; mem.CardOffset = srambase;
mem.Page = 0; mem.Page = 0;
ret = pcmcia_map_mem_page(info->sram_win_handle, &mem); ret = pcmcia_map_mem_page(link, info->sram_win_handle, &mem);
if (ret) if (ret)
goto failed; goto failed;

View File

@ -325,7 +325,7 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
mem.Page = 0; mem.Page = 0;
for (i = 0; i < NR_INFO; i++) { for (i = 0; i < NR_INFO; i++) {
mem.CardOffset = hw_info[i].offset & ~(req.Size-1); mem.CardOffset = hw_info[i].offset & ~(req.Size-1);
pcmcia_map_mem_page(link->win, &mem); pcmcia_map_mem_page(link, link->win, &mem);
base = &virt[hw_info[i].offset & (req.Size-1)]; base = &virt[hw_info[i].offset & (req.Size-1)];
if ((readb(base+0) == hw_info[i].a0) && if ((readb(base+0) == hw_info[i].a0) &&
(readb(base+2) == hw_info[i].a1) && (readb(base+2) == hw_info[i].a1) &&
@ -1499,7 +1499,7 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
offset = mem.CardOffset % window_size; offset = mem.CardOffset % window_size;
mem.CardOffset -= offset; mem.CardOffset -= offset;
mem.Page = 0; mem.Page = 0;
ret = pcmcia_map_mem_page(link->win, &mem); ret = pcmcia_map_mem_page(link, link->win, &mem);
if (ret) if (ret)
goto failed; goto failed;

View File

@ -480,7 +480,7 @@ static int mhz_mfc_config(struct pcmcia_device *link)
mem.CardOffset = mem.Page = 0; mem.CardOffset = mem.Page = 0;
if (smc->manfid == MANFID_MOTOROLA) if (smc->manfid == MANFID_MOTOROLA)
mem.CardOffset = link->conf.ConfigBase; mem.CardOffset = link->conf.ConfigBase;
i = pcmcia_map_mem_page(link->win, &mem); i = pcmcia_map_mem_page(link, link->win, &mem);
if ((i == 0) if ((i == 0)
&& (smc->manfid == MANFID_MEGAHERTZ) && (smc->manfid == MANFID_MEGAHERTZ)

View File

@ -932,7 +932,7 @@ xirc2ps_config(struct pcmcia_device * link)
local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800;
mem.CardOffset = 0x0; mem.CardOffset = 0x0;
mem.Page = 0; mem.Page = 0;
if ((err = pcmcia_map_mem_page(link->win, &mem))) if ((err = pcmcia_map_mem_page(link, link->win, &mem)))
goto config_error; goto config_error;
/* Setup the CCRs; there are no infos in the CIS about the Ethernet /* Setup the CCRs; there are no infos in the CIS about the Ethernet

View File

@ -261,7 +261,7 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,
return -ENODEV; return -ENODEV;
map.Page = 0; map.Page = 0;
map.CardOffset = mem->win[0].card_addr; map.CardOffset = mem->win[0].card_addr;
if (pcmcia_map_mem_page(p_dev->win, &map) != 0) if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0)
return -ENODEV; return -ENODEV;
} }
/* If we got this far, we're cool! */ /* If we got this far, we're cool! */

View File

@ -93,7 +93,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
mem.CardOffset = 0; mem.CardOffset = 0;
mem.Page = 0; mem.Page = 0;
res = pcmcia_map_mem_page(dev->win, &mem); res = pcmcia_map_mem_page(dev, dev->win, &mem);
if (res != 0) if (res != 0)
goto err_disable; goto err_disable;

View File

@ -763,7 +763,7 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
if (ret) if (ret)
goto failed; goto failed;
mem.CardOffset = 0x20000; mem.Page = 0; mem.CardOffset = 0x20000; mem.Page = 0;
ret = pcmcia_map_mem_page(link->win, &mem); ret = pcmcia_map_mem_page(link, link->win, &mem);
if (ret) if (ret)
goto failed; goto failed;

View File

@ -443,7 +443,7 @@ static int ray_config(struct pcmcia_device *link)
goto failed; goto failed;
mem.CardOffset = 0x0000; mem.CardOffset = 0x0000;
mem.Page = 0; mem.Page = 0;
ret = pcmcia_map_mem_page(link->win, &mem); ret = pcmcia_map_mem_page(link, link->win, &mem);
if (ret) if (ret)
goto failed; goto failed;
local->sram = ioremap(req.Base, req.Size); local->sram = ioremap(req.Base, req.Size);
@ -459,7 +459,7 @@ static int ray_config(struct pcmcia_device *link)
goto failed; goto failed;
mem.CardOffset = 0x8000; mem.CardOffset = 0x8000;
mem.Page = 0; mem.Page = 0;
ret = pcmcia_map_mem_page(local->rmem_handle, &mem); ret = pcmcia_map_mem_page(link, local->rmem_handle, &mem);
if (ret) if (ret)
goto failed; goto failed;
local->rmem = ioremap(req.Base, req.Size); local->rmem = ioremap(req.Base, req.Size);
@ -475,7 +475,7 @@ static int ray_config(struct pcmcia_device *link)
goto failed; goto failed;
mem.CardOffset = 0x0000; mem.CardOffset = 0x0000;
mem.Page = 0; mem.Page = 0;
ret = pcmcia_map_mem_page(local->amem_handle, &mem); ret = pcmcia_map_mem_page(link, local->amem_handle, &mem);
if (ret) if (ret)
goto failed; goto failed;
local->amem = ioremap(req.Base, req.Size); local->amem = ioremap(req.Base, req.Size);

View File

@ -3885,7 +3885,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
dev->mem_end = dev->mem_start + req.Size; dev->mem_end = dev->mem_start + req.Size;
mem.CardOffset = 0; mem.Page = 0; mem.CardOffset = 0; mem.Page = 0;
i = pcmcia_map_mem_page(link->win, &mem); i = pcmcia_map_mem_page(link, link->win, &mem);
if (i != 0) if (i != 0)
break; break;

View File

@ -234,9 +234,12 @@ int pcmcia_get_mem_page(window_handle_t win, memreq_t *req)
EXPORT_SYMBOL(pcmcia_get_mem_page); EXPORT_SYMBOL(pcmcia_get_mem_page);
int pcmcia_map_mem_page(window_handle_t win, memreq_t *req) int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh,
memreq_t *req)
{ {
struct pcmcia_socket *s; struct pcmcia_socket *s;
window_handle_t win = wh;
if ((win == NULL) || (win->magic != WINDOW_MAGIC)) if ((win == NULL) || (win->magic != WINDOW_MAGIC))
return -EINVAL; return -EINVAL;
s = win->sock; s = win->sock;

View File

@ -1687,7 +1687,7 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
if (pcmcia_request_window(&p_dev, &cfg_mem->req, &p_dev->win) != 0) if (pcmcia_request_window(&p_dev, &cfg_mem->req, &p_dev->win) != 0)
goto next_entry; goto next_entry;
map.Page = 0; map.CardOffset = mem->win[0].card_addr; map.Page = 0; map.CardOffset = mem->win[0].card_addr;
if (pcmcia_map_mem_page(p_dev->win, &map) != 0) if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0)
goto next_entry; goto next_entry;
cfg_mem->data->MmioAddress = (unsigned long) ioremap_nocache(cfg_mem->req.Base, cfg_mem->req.Size); cfg_mem->data->MmioAddress = (unsigned long) ioremap_nocache(cfg_mem->req.Base, cfg_mem->req.Size);

View File

@ -616,7 +616,7 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
return -ENODEV; return -ENODEV;
map.Page = 0; map.Page = 0;
map.CardOffset = mem->win[0].card_addr; map.CardOffset = mem->win[0].card_addr;
if (pcmcia_map_mem_page(p_dev->win, &map)) if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
return -ENODEV; return -ENODEV;
} }
/* If we got this far, we're cool! */ /* If we got this far, we're cool! */

View File

@ -367,7 +367,7 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
return -ENODEV; return -ENODEV;
map.Page = 0; map.Page = 0;
map.CardOffset = mem->win[0].card_addr; map.CardOffset = mem->win[0].card_addr;
if (pcmcia_map_mem_page(p_dev->win, &map)) if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
return -ENODEV; return -ENODEV;
} }
/* If we got this far, we're cool! */ /* If we got this far, we're cool! */

View File

@ -346,7 +346,7 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
return -ENODEV; return -ENODEV;
map.Page = 0; map.Page = 0;
map.CardOffset = mem->win[0].card_addr; map.CardOffset = mem->win[0].card_addr;
if (pcmcia_map_mem_page(p_dev->win, &map)) if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
return -ENODEV; return -ENODEV;
} }
/* If we got this far, we're cool! */ /* If we got this far, we're cool! */

View File

@ -204,7 +204,8 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req,
int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win); int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win);
int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win,
memreq_t *req);
int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
void pcmcia_disable_device(struct pcmcia_device *p_dev); void pcmcia_disable_device(struct pcmcia_device *p_dev);