[PATCH 08/15] pcmcia: call CIS cleanup from ds.c

Dominik Brodowski linux at dominikbrodowski.net
Wed Jan 6 06:46:19 EST 2010


As ds.c is the only real user of CIS access functions, call the
cleanup functions from ds.c, too.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/cs.c |    3 ---
 drivers/pcmcia/ds.c |    4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 2454643..13ca458 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -283,8 +283,6 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
 	if (socket->thread)
 		kthread_stop(socket->thread);
 
-	release_cis_mem(socket);
-
 	/* remove from our own list */
 	down_write(&pcmcia_socket_list_rwsem);
 	list_del(&socket->socket_list);
@@ -399,7 +397,6 @@ static void socket_shutdown(struct pcmcia_socket *s)
 	s->ops->set_socket(s, &s->socket);
 	s->irq.AssignedIRQ = s->irq.Config = 0;
 	s->lock_count = 0;
-	destroy_cis_cache(s);
 	kfree(s->fake_cis);
 	s->fake_cis = NULL;
 #ifdef CONFIG_CARDBUS
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 87e0639..82b6a4b 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -1241,10 +1241,12 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
 		s->pcmcia_state.present = 0;
 		pcmcia_card_remove(skt, NULL);
 		handle_event(skt, event);
+		destroy_cis_cache(s);
 		break;
 
 	case CS_EVENT_CARD_INSERTION:
 		s->pcmcia_state.present = 1;
+		destroy_cis_cache(s); /* to be on the safe side... */
 		pcmcia_card_add(skt);
 		handle_event(skt, event);
 		break;
@@ -1368,6 +1370,8 @@ static void pcmcia_bus_remove_socket(struct device *dev,
 	pcmcia_card_remove(socket, NULL);
 	mutex_unlock(&socket->skt_mutex);
 
+	release_cis_mem(socket);
+
 	pcmcia_put_socket(socket);
 
 	return;
-- 
1.6.3.3




More information about the linux-pcmcia mailing list