follow-up-patches [8/10] reset_card by socket
Dominik Brodowski
linux at brodo.de
Sat Nov 22 14:09:34 GMT 2003
The pcmcia_reset_card function is called by either the cardctl userspace
tool via ds.c or by two PCMCIA drivers via CardServices. The "handle" can
be replaced by the struct pcmcia_socket, however this means that no
CS_EVENT_RESET_COMPLETE event is sent to back to the issuing handle.
However, a grep -R in both the pcmcia-cs and in the kernel sources show
that this event is never used. So, remove it.
drivers/pcmcia/cs.c | 13 +------------
drivers/pcmcia/ds.c | 7 +++++--
include/pcmcia/cs.h | 2 +-
3 files changed, 7 insertions(+), 15 deletions(-)
diff -ruN linux-original/drivers/pcmcia/cs.c linux/drivers/pcmcia/cs.c
--- linux-original/drivers/pcmcia/cs.c 2003-11-22 12:14:48.507579872 +0100
+++ linux/drivers/pcmcia/cs.c 2003-11-22 12:44:01.028156248 +0100
@@ -1901,16 +1901,10 @@
======================================================================*/
-int pcmcia_reset_card(client_handle_t handle, client_req_t *req)
+int pcmcia_reset_card(struct pcmcia_socket *skt)
{
- struct pcmcia_socket *skt;
int ret;
- if (CHECK_HANDLE(handle))
- return CS_BAD_HANDLE;
- DEBUG(1, "cs: resetting socket %p\n", handle->Socket);
- skt = SOCKET(handle);
-
down(&skt->skt_sem);
do {
if (!(skt->state & SOCKET_PRESENT)) {
@@ -1932,11 +1926,6 @@
if (socket_reset(skt) == CS_SUCCESS)
send_event(skt, CS_EVENT_CARD_RESET, CS_EVENT_PRI_LOW);
}
-
- handle->event_callback_args.info = (void *)(u_long)ret;
- EVENT(handle, CS_EVENT_RESET_COMPLETE, CS_EVENT_PRI_LOW);
-
- ret = CS_SUCCESS;
} while (0);
up(&skt->skt_sem);
diff -ruN linux-original/drivers/pcmcia/ds.c linux/drivers/pcmcia/ds.c
--- linux-original/drivers/pcmcia/ds.c 2003-11-22 12:18:43.602839960 +0100
+++ linux/drivers/pcmcia/ds.c 2003-11-22 12:44:01.006159592 +0100
@@ -444,7 +444,10 @@
}
break;
case ResetCard:
- return pcmcia_reset_card(a1, a2); break;
+ {
+ client_handle_t h = a1;
+ return pcmcia_reset_card(h->Socket); break;
+ }
case SetEventMask:
return pcmcia_set_event_mask(a1, a2); break;
case ValidateCIS:
@@ -1064,7 +1067,7 @@
ret = pcmcia_parse_tuple(s->handle, &buf.tuple, &buf.tuple_parse.parse);
break;
case DS_RESET_CARD:
- ret = pcmcia_reset_card(s->handle, NULL);
+ ret = pcmcia_reset_card(s->parent);
break;
case DS_GET_STATUS:
ret = pcmcia_get_status(s->handle, &buf.status);
diff -ruN linux-original/include/pcmcia/cs.h linux/include/pcmcia/cs.h
--- linux-original/include/pcmcia/cs.h 2003-11-22 12:18:43.604839656 +0100
+++ linux/include/pcmcia/cs.h 2003-11-22 12:44:01.047153360 +0100
@@ -450,7 +450,7 @@
int pcmcia_request_io(client_handle_t handle, io_req_t *req);
int pcmcia_request_irq(client_handle_t handle, irq_req_t *req);
int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle_t *wh);
-int pcmcia_reset_card(client_handle_t handle, client_req_t *req);
+int pcmcia_reset_card(struct pcmcia_socket *skt);
int pcmcia_suspend_card(struct pcmcia_socket *skt);
int pcmcia_resume_card(struct pcmcia_socket *skt);
int pcmcia_eject_card(struct pcmcia_socket *skt);
More information about the linux-pcmcia
mailing list