aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pcmcia_resource.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-07-07 20:59:01 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:24:06 -0400
commite12a9a93a8417c4f2aa46ce8346c2d27e656b9a2 (patch)
treeca4295237f29c54901c199b322e504f89a45c902 /drivers/pcmcia/pcmcia_resource.c
parent1e212f3645a6b355de8c43a23376bc0e2ac49a63 (diff)
[PATCH] pcmcia: remove client_t usage
Reduce the occurences of "client_handle_t" which is nothing else than a pointer to struct pcmcia_device by now. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pcmcia/pcmcia_resource.c')
-rw-r--r--drivers/pcmcia/pcmcia_resource.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index c01dc6bf1526..ac5c3abe70c0 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -206,10 +206,8 @@ int pcmcia_access_configuration_register(client_handle_t handle,
206 conf_reg_t *reg) 206 conf_reg_t *reg)
207{ 207{
208 struct pcmcia_socket *s; 208 struct pcmcia_socket *s;
209 if (CHECK_HANDLE(handle))
210 return CS_BAD_HANDLE;
211 s = SOCKET(handle); 209 s = SOCKET(handle);
212 return pccard_access_configuration_register(s, handle->Function, reg); 210 return pccard_access_configuration_register(s, handle->func, reg);
213} 211}
214EXPORT_SYMBOL(pcmcia_access_configuration_register); 212EXPORT_SYMBOL(pcmcia_access_configuration_register);
215 213
@@ -276,12 +274,12 @@ int pcmcia_get_configuration_info(client_handle_t handle,
276{ 274{
277 struct pcmcia_socket *s; 275 struct pcmcia_socket *s;
278 276
279 if ((CHECK_HANDLE(handle)) || !config) 277 if (!config)
280 return CS_BAD_HANDLE; 278 return CS_BAD_HANDLE;
281 s = SOCKET(handle); 279 s = SOCKET(handle);
282 if (!s) 280 if (!s)
283 return CS_BAD_HANDLE; 281 return CS_BAD_HANDLE;
284 return pccard_get_configuration_info(s, handle->Function, config); 282 return pccard_get_configuration_info(s, handle->func, config);
285} 283}
286EXPORT_SYMBOL(pcmcia_get_configuration_info); 284EXPORT_SYMBOL(pcmcia_get_configuration_info);
287 285
@@ -382,10 +380,8 @@ int pccard_get_status(struct pcmcia_socket *s, unsigned int function,
382int pcmcia_get_status(client_handle_t handle, cs_status_t *status) 380int pcmcia_get_status(client_handle_t handle, cs_status_t *status)
383{ 381{
384 struct pcmcia_socket *s; 382 struct pcmcia_socket *s;
385 if (CHECK_HANDLE(handle))
386 return CS_BAD_HANDLE;
387 s = SOCKET(handle); 383 s = SOCKET(handle);
388 return pccard_get_status(s, handle->Function, status); 384 return pccard_get_status(s, handle->func, status);
389} 385}
390EXPORT_SYMBOL(pcmcia_get_status); 386EXPORT_SYMBOL(pcmcia_get_status);
391 387
@@ -432,8 +428,6 @@ int pcmcia_modify_configuration(client_handle_t handle,
432 struct pcmcia_socket *s; 428 struct pcmcia_socket *s;
433 config_t *c; 429 config_t *c;
434 430
435 if (CHECK_HANDLE(handle))
436 return CS_BAD_HANDLE;
437 s = SOCKET(handle); 431 s = SOCKET(handle);
438 c = CONFIG(handle); 432 c = CONFIG(handle);
439 if (!(s->state & SOCKET_PRESENT)) 433 if (!(s->state & SOCKET_PRESENT))
@@ -478,8 +472,7 @@ int pcmcia_release_configuration(client_handle_t handle)
478 struct pcmcia_socket *s; 472 struct pcmcia_socket *s;
479 int i; 473 int i;
480 474
481 if (CHECK_HANDLE(handle) || 475 if (!(handle->state & CLIENT_CONFIG_LOCKED))
482 !(handle->state & CLIENT_CONFIG_LOCKED))
483 return CS_BAD_HANDLE; 476 return CS_BAD_HANDLE;
484 handle->state &= ~CLIENT_CONFIG_LOCKED; 477 handle->state &= ~CLIENT_CONFIG_LOCKED;
485 s = SOCKET(handle); 478 s = SOCKET(handle);
@@ -527,7 +520,7 @@ int pcmcia_release_io(client_handle_t handle, io_req_t *req)
527{ 520{
528 struct pcmcia_socket *s; 521 struct pcmcia_socket *s;
529 522
530 if (CHECK_HANDLE(handle) || !(handle->state & CLIENT_IO_REQ)) 523 if (!(handle->state & CLIENT_IO_REQ))
531 return CS_BAD_HANDLE; 524 return CS_BAD_HANDLE;
532 handle->state &= ~CLIENT_IO_REQ; 525 handle->state &= ~CLIENT_IO_REQ;
533 s = SOCKET(handle); 526 s = SOCKET(handle);
@@ -561,7 +554,7 @@ EXPORT_SYMBOL(pcmcia_release_io);
561int pcmcia_release_irq(client_handle_t handle, irq_req_t *req) 554int pcmcia_release_irq(client_handle_t handle, irq_req_t *req)
562{ 555{
563 struct pcmcia_socket *s; 556 struct pcmcia_socket *s;
564 if (CHECK_HANDLE(handle) || !(handle->state & CLIENT_IRQ_REQ)) 557 if (!(handle->state & CLIENT_IRQ_REQ))
565 return CS_BAD_HANDLE; 558 return CS_BAD_HANDLE;
566 handle->state &= ~CLIENT_IRQ_REQ; 559 handle->state &= ~CLIENT_IRQ_REQ;
567 s = SOCKET(handle); 560 s = SOCKET(handle);
@@ -632,8 +625,6 @@ int pcmcia_request_configuration(client_handle_t handle,
632 config_t *c; 625 config_t *c;
633 pccard_io_map iomap; 626 pccard_io_map iomap;
634 627
635 if (CHECK_HANDLE(handle))
636 return CS_BAD_HANDLE;
637 s = SOCKET(handle); 628 s = SOCKET(handle);
638 if (!(s->state & SOCKET_PRESENT)) 629 if (!(s->state & SOCKET_PRESENT))
639 return CS_NO_CARD; 630 return CS_NO_CARD;
@@ -762,8 +753,6 @@ int pcmcia_request_io(client_handle_t handle, io_req_t *req)
762 struct pcmcia_socket *s; 753 struct pcmcia_socket *s;
763 config_t *c; 754 config_t *c;
764 755
765 if (CHECK_HANDLE(handle))
766 return CS_BAD_HANDLE;
767 s = SOCKET(handle); 756 s = SOCKET(handle);
768 if (!(s->state & SOCKET_PRESENT)) 757 if (!(s->state & SOCKET_PRESENT))
769 return CS_NO_CARD; 758 return CS_NO_CARD;
@@ -834,8 +823,6 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req)
834 int ret = CS_IN_USE, irq = 0; 823 int ret = CS_IN_USE, irq = 0;
835 struct pcmcia_device *p_dev = handle_to_pdev(handle); 824 struct pcmcia_device *p_dev = handle_to_pdev(handle);
836 825
837 if (CHECK_HANDLE(handle))
838 return CS_BAD_HANDLE;
839 s = SOCKET(handle); 826 s = SOCKET(handle);
840 if (!(s->state & SOCKET_PRESENT)) 827 if (!(s->state & SOCKET_PRESENT))
841 return CS_NO_CARD; 828 return CS_NO_CARD;
@@ -926,9 +913,7 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
926 u_long align; 913 u_long align;
927 int w; 914 int w;
928 915
929 if (CHECK_HANDLE(*handle)) 916 s = (*handle)->socket;
930 return CS_BAD_HANDLE;
931 s = (*handle)->Socket;
932 if (!(s->state & SOCKET_PRESENT)) 917 if (!(s->state & SOCKET_PRESENT))
933 return CS_NO_CARD; 918 return CS_NO_CARD;
934 if (req->Attributes & (WIN_PAGED | WIN_SHARED)) 919 if (req->Attributes & (WIN_PAGED | WIN_SHARED))