
From: Dominik Brodowski <linux@dominikbrodowski.de>

Use pcmcia_dev instead of the "client" single-linked list to mark
clients as stale.

Signed-off-by: Dominik Brodowski <linux@brodo.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/pcmcia/ds.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff -puN drivers/pcmcia/ds.c~pcmcia-use-pcmcia_device-to-mark-clients-as-stale drivers/pcmcia/ds.c
--- 25/drivers/pcmcia/ds.c~pcmcia-use-pcmcia_device-to-mark-clients-as-stale	2004-12-03 18:44:39.108837752 -0800
+++ 25-akpm/drivers/pcmcia/ds.c	2004-12-03 18:44:39.113836992 -0800
@@ -586,8 +586,9 @@ static int send_event(struct pcmcia_sock
 static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
 {
 	struct pcmcia_bus_socket *s = skt->pcmcia;
+	struct pcmcia_device *p_dev;
+	unsigned long flags;
 	int ret = 0;
-	client_t *client;
 
 	ds_dbg(1, "ds_event(0x%06x, %d, 0x%p)\n",
 	       event, priority, s);
@@ -598,8 +599,10 @@ static int ds_event(struct pcmcia_socket
 		s->state &= ~DS_SOCKET_PRESENT;
 	    	send_event(skt, event, priority);
 		handle_event(s, event);
-		for (client = skt->clients; client; client = client->next)
-			client->state |= CLIENT_STALE;
+		spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
+		list_for_each_entry(p_dev, &s->devices_list, socket_device_list)
+			p_dev->client->state |= CLIENT_STALE;
+		spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
 		break;
 	
 	case CS_EVENT_CARD_INSERTION:
_
