提交 6838b03f 编写于 作者: D Dominik Brodowski

pcmcia: pcmcia_request_window() doesn't need a pointer to a pointer

pcmcia_request_window() only needs a pointer to struct pcmcia_device, not
a pointer to a pointer.

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: NDominik Brodowski <linux@dominikbrodowski.net>
上级 82f88e36
...@@ -116,7 +116,7 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, ...@@ -116,7 +116,7 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,
ipw->request_common_memory.Size = 0x1000; ipw->request_common_memory.Size = 0x1000;
ipw->request_common_memory.AccessSpeed = 0; ipw->request_common_memory.AccessSpeed = 0;
ret = pcmcia_request_window(&p_dev, &ipw->request_common_memory, ret = pcmcia_request_window(p_dev, &ipw->request_common_memory,
&ipw->handle_common_memory); &ipw->handle_common_memory);
if (ret != 0) if (ret != 0)
...@@ -145,7 +145,7 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, ...@@ -145,7 +145,7 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,
ipw->request_attr_memory.Size = 0; /* this used to be 0x1000 */ ipw->request_attr_memory.Size = 0; /* this used to be 0x1000 */
ipw->request_attr_memory.AccessSpeed = 0; ipw->request_attr_memory.AccessSpeed = 0;
ret = pcmcia_request_window(&p_dev, &ipw->request_attr_memory, ret = pcmcia_request_window(p_dev, &ipw->request_attr_memory,
&ipw->handle_attr_memory); &ipw->handle_attr_memory);
if (ret != 0) if (ret != 0)
......
...@@ -272,7 +272,7 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev, ...@@ -272,7 +272,7 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
req->Base = mem->win[0].host_addr; req->Base = mem->win[0].host_addr;
req->Size = mem->win[0].len; req->Size = mem->win[0].len;
req->AccessSpeed = 0; req->AccessSpeed = 0;
if (pcmcia_request_window(&p_dev, req, &p_dev->win) != 0) if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0)
return -ENODEV; return -ENODEV;
map.Page = 0; map.Page = 0;
map.CardOffset = mem->win[0].card_addr; map.CardOffset = mem->win[0].card_addr;
......
...@@ -530,7 +530,7 @@ static int pcmciamtd_config(struct pcmcia_device *link) ...@@ -530,7 +530,7 @@ static int pcmciamtd_config(struct pcmcia_device *link)
int ret; int ret;
DEBUG(2, "requesting window with size = %dKiB memspeed = %d", DEBUG(2, "requesting window with size = %dKiB memspeed = %d",
req.Size >> 10, req.AccessSpeed); req.Size >> 10, req.AccessSpeed);
ret = pcmcia_request_window(&link, &req, &link->win); ret = pcmcia_request_window(link, &req, &link->win);
DEBUG(2, "ret = %d dev->win_size = %d", ret, dev->win_size); DEBUG(2, "ret = %d dev->win_size = %d", ret, dev->win_size);
if(ret) { if(ret) {
req.Size >>= 1; req.Size >>= 1;
......
...@@ -567,7 +567,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) ...@@ -567,7 +567,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
req.Base = 0; req.Size = 0; req.Base = 0; req.Size = 0;
req.AccessSpeed = 0; req.AccessSpeed = 0;
i = pcmcia_request_window(&link, &req, &link->win); i = pcmcia_request_window(link, &req, &link->win);
if (i != 0) if (i != 0)
return -1; return -1;
...@@ -618,7 +618,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link) ...@@ -618,7 +618,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link)
req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
req.Base = 0; req.Size = 0; req.Base = 0; req.Size = 0;
req.AccessSpeed = 0; req.AccessSpeed = 0;
i = pcmcia_request_window(&link, &req, &link->win); i = pcmcia_request_window(link, &req, &link->win);
if (i != 0) if (i != 0)
return -1; return -1;
......
...@@ -246,7 +246,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) ...@@ -246,7 +246,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
req.Base = 0; req.Base = 0;
req.Size = 0x2000; req.Size = 0x2000;
req.AccessSpeed = 250; req.AccessSpeed = 250;
ret = pcmcia_request_window(&link, &req, &link->win); ret = pcmcia_request_window(link, &req, &link->win);
if (ret) if (ret)
goto failed; goto failed;
...@@ -263,7 +263,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) ...@@ -263,7 +263,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
req.Base = 0; req.Base = 0;
req.Size = sramsize * 1024; req.Size = sramsize * 1024;
req.AccessSpeed = 250; req.AccessSpeed = 250;
ret = pcmcia_request_window(&link, &req, &info->sram_win_handle); ret = pcmcia_request_window(link, &req, &info->sram_win_handle);
if (ret) if (ret)
goto failed; goto failed;
......
...@@ -317,7 +317,7 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link) ...@@ -317,7 +317,7 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
req.Base = 0; req.Size = 0; req.Base = 0; req.Size = 0;
req.AccessSpeed = 0; req.AccessSpeed = 0;
i = pcmcia_request_window(&link, &req, &link->win); i = pcmcia_request_window(link, &req, &link->win);
if (i != 0) if (i != 0)
return NULL; return NULL;
...@@ -1491,7 +1491,7 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg, ...@@ -1491,7 +1491,7 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
req.Attributes |= WIN_USE_WAIT; req.Attributes |= WIN_USE_WAIT;
req.Base = 0; req.Size = window_size; req.Base = 0; req.Size = window_size;
req.AccessSpeed = mem_speed; req.AccessSpeed = mem_speed;
ret = pcmcia_request_window(&link, &req, &link->win); ret = pcmcia_request_window(link, &req, &link->win);
if (ret) if (ret)
goto failed; goto failed;
......
...@@ -472,7 +472,7 @@ static int mhz_mfc_config(struct pcmcia_device *link) ...@@ -472,7 +472,7 @@ static int mhz_mfc_config(struct pcmcia_device *link)
req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
req.Base = req.Size = 0; req.Base = req.Size = 0;
req.AccessSpeed = 0; req.AccessSpeed = 0;
i = pcmcia_request_window(&link, &req, &link->win); i = pcmcia_request_window(link, &req, &link->win);
if (i != 0) if (i != 0)
return -ENODEV; return -ENODEV;
......
...@@ -926,7 +926,7 @@ xirc2ps_config(struct pcmcia_device * link) ...@@ -926,7 +926,7 @@ xirc2ps_config(struct pcmcia_device * link)
req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
req.Base = req.Size = 0; req.Base = req.Size = 0;
req.AccessSpeed = 0; req.AccessSpeed = 0;
if ((err = pcmcia_request_window(&link, &req, &link->win))) if ((err = pcmcia_request_window(link, &req, &link->win)))
goto config_error; goto config_error;
local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800;
......
...@@ -257,7 +257,7 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, ...@@ -257,7 +257,7 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,
req->Base = mem->win[0].host_addr; req->Base = mem->win[0].host_addr;
req->Size = mem->win[0].len; req->Size = mem->win[0].len;
req->AccessSpeed = 0; req->AccessSpeed = 0;
if (pcmcia_request_window(&p_dev, req, &p_dev->win) != 0) if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0)
return -ENODEV; return -ENODEV;
map.Page = 0; map.Page = 0;
map.CardOffset = mem->win[0].card_addr; map.CardOffset = mem->win[0].card_addr;
......
...@@ -87,7 +87,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) ...@@ -87,7 +87,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
win.Base = 0; win.Base = 0;
win.Size = SSB_CORE_SIZE; win.Size = SSB_CORE_SIZE;
win.AccessSpeed = 250; win.AccessSpeed = 250;
res = pcmcia_request_window(&dev, &win, &dev->win); res = pcmcia_request_window(dev, &win, &dev->win);
if (res != 0) if (res != 0)
goto err_kfree_ssb; goto err_kfree_ssb;
......
...@@ -759,7 +759,7 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) { ...@@ -759,7 +759,7 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_CM|WIN_ENABLE; req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
req.Base = 0; req.Size = 0x8000; req.Base = 0; req.Size = 0x8000;
req.AccessSpeed = mem_speed; req.AccessSpeed = mem_speed;
ret = pcmcia_request_window(&link, &req, &link->win); ret = pcmcia_request_window(link, &req, &link->win);
if (ret) if (ret)
goto failed; goto failed;
mem.CardOffset = 0x20000; mem.Page = 0; mem.CardOffset = 0x20000; mem.Page = 0;
......
...@@ -438,7 +438,7 @@ static int ray_config(struct pcmcia_device *link) ...@@ -438,7 +438,7 @@ static int ray_config(struct pcmcia_device *link)
req.Base = 0; req.Base = 0;
req.Size = 0x8000; req.Size = 0x8000;
req.AccessSpeed = ray_mem_speed; req.AccessSpeed = ray_mem_speed;
ret = pcmcia_request_window(&link, &req, &link->win); ret = pcmcia_request_window(link, &req, &link->win);
if (ret) if (ret)
goto failed; goto failed;
mem.CardOffset = 0x0000; mem.CardOffset = 0x0000;
...@@ -454,7 +454,7 @@ static int ray_config(struct pcmcia_device *link) ...@@ -454,7 +454,7 @@ static int ray_config(struct pcmcia_device *link)
req.Base = 0; req.Base = 0;
req.Size = 0x4000; req.Size = 0x4000;
req.AccessSpeed = ray_mem_speed; req.AccessSpeed = ray_mem_speed;
ret = pcmcia_request_window(&link, &req, &local->rmem_handle); ret = pcmcia_request_window(link, &req, &local->rmem_handle);
if (ret) if (ret)
goto failed; goto failed;
mem.CardOffset = 0x8000; mem.CardOffset = 0x8000;
...@@ -470,7 +470,7 @@ static int ray_config(struct pcmcia_device *link) ...@@ -470,7 +470,7 @@ static int ray_config(struct pcmcia_device *link)
req.Base = 0; req.Base = 0;
req.Size = 0x1000; req.Size = 0x1000;
req.AccessSpeed = ray_mem_speed; req.AccessSpeed = ray_mem_speed;
ret = pcmcia_request_window(&link, &req, &local->amem_handle); ret = pcmcia_request_window(link, &req, &local->amem_handle);
if (ret) if (ret)
goto failed; goto failed;
mem.CardOffset = 0x0000; mem.CardOffset = 0x0000;
......
...@@ -3876,7 +3876,7 @@ wv_pcmcia_config(struct pcmcia_device * link) ...@@ -3876,7 +3876,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
req.Base = req.Size = 0; req.Base = req.Size = 0;
req.AccessSpeed = mem_speed; req.AccessSpeed = mem_speed;
i = pcmcia_request_window(&link, &req, &link->win); i = pcmcia_request_window(link, &req, &link->win);
if (i != 0) if (i != 0)
break; break;
......
...@@ -752,9 +752,9 @@ EXPORT_SYMBOL(pcmcia_request_irq); ...@@ -752,9 +752,9 @@ EXPORT_SYMBOL(pcmcia_request_irq);
* Request_window() establishes a mapping between card memory space * Request_window() establishes a mapping between card memory space
* and system memory space. * and system memory space.
*/ */
int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh) int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_handle_t *wh)
{ {
struct pcmcia_socket *s = (*p_dev)->socket; struct pcmcia_socket *s = p_dev->socket;
pccard_mem_map *win; pccard_mem_map *win;
u_long align; u_long align;
int w; int w;
...@@ -804,7 +804,7 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h ...@@ -804,7 +804,7 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h
return -EINVAL; return -EINVAL;
} }
} }
(*p_dev)->_win |= CLIENT_WIN_REQ(w); p_dev->_win |= CLIENT_WIN_REQ(w);
/* Configure the socket controller */ /* Configure the socket controller */
win->map = w+1; win->map = w+1;
......
...@@ -1684,7 +1684,7 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev, ...@@ -1684,7 +1684,7 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
if (cfg_mem->req.Size < 0x1000) if (cfg_mem->req.Size < 0x1000)
cfg_mem->req.Size = 0x1000; cfg_mem->req.Size = 0x1000;
cfg_mem->req.AccessSpeed = 0; cfg_mem->req.AccessSpeed = 0;
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, p_dev->win, &map) != 0) if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0)
......
...@@ -612,7 +612,7 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, ...@@ -612,7 +612,7 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
if (req->Size < 0x1000) if (req->Size < 0x1000)
req->Size = 0x1000; req->Size = 0x1000;
req->AccessSpeed = 0; req->AccessSpeed = 0;
if (pcmcia_request_window(&p_dev, req, &p_dev->win)) if (pcmcia_request_window(p_dev, req, &p_dev->win))
return -ENODEV; return -ENODEV;
map.Page = 0; map.Page = 0;
map.CardOffset = mem->win[0].card_addr; map.CardOffset = mem->win[0].card_addr;
......
...@@ -363,7 +363,7 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, ...@@ -363,7 +363,7 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
if (req->Size < 0x1000) if (req->Size < 0x1000)
req->Size = 0x1000; req->Size = 0x1000;
req->AccessSpeed = 0; req->AccessSpeed = 0;
if (pcmcia_request_window(&p_dev, req, &p_dev->win)) if (pcmcia_request_window(p_dev, req, &p_dev->win))
return -ENODEV; return -ENODEV;
map.Page = 0; map.Page = 0;
map.CardOffset = mem->win[0].card_addr; map.CardOffset = mem->win[0].card_addr;
......
...@@ -342,7 +342,7 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, ...@@ -342,7 +342,7 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
if (req->Size < 0x1000) if (req->Size < 0x1000)
req->Size = 0x1000; req->Size = 0x1000;
req->AccessSpeed = 0; req->AccessSpeed = 0;
if (pcmcia_request_window(&p_dev, req, &p_dev->win)) if (pcmcia_request_window(p_dev, req, &p_dev->win))
return -ENODEV; return -ENODEV;
map.Page = 0; map.Page = 0;
map.CardOffset = mem->win[0].card_addr; map.CardOffset = mem->win[0].card_addr;
......
...@@ -199,7 +199,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); ...@@ -199,7 +199,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req);
int pcmcia_request_configuration(struct pcmcia_device *p_dev, int pcmcia_request_configuration(struct pcmcia_device *p_dev,
config_req_t *req); config_req_t *req);
int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req,
window_handle_t *wh); window_handle_t *wh);
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_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win, int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册