
From: Dominik Brodowski <linux@dominikbrodowski.net>

Generate hotplug event for PCMCIA sockets being registered.

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

 25-akpm/drivers/pcmcia/cs.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+)

diff -puN drivers/pcmcia/cs.c~pcmcia-hotplug-event-for-pcmcia-socket-devices drivers/pcmcia/cs.c
--- 25/drivers/pcmcia/cs.c~pcmcia-hotplug-event-for-pcmcia-socket-devices	Sun Mar  6 17:28:05 2005
+++ 25-akpm/drivers/pcmcia/cs.c	Sun Mar  6 17:28:05 2005
@@ -1850,6 +1850,21 @@ int pcmcia_insert_card(struct pcmcia_soc
 	return ret;
 } /* insert_card */
 
+static int pcmcia_socket_hotplug(struct class_device *dev, char **envp,
+				int num_envp, char *buffer, int buffer_size)
+{
+	struct pcmcia_socket *s = container_of(dev, struct pcmcia_socket, dev);
+	int i = 0, length = 0;
+
+	if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size,
+				&length, "SOCKET_NO=%u", s->sock))
+		return -ENOMEM;
+
+	envp[i] = NULL;
+
+	return 0;
+}
+
 /*======================================================================
 
     OS-specific module glue goes here
@@ -1879,6 +1894,7 @@ EXPORT_SYMBOL(pcmcia_parse_events);
 
 struct class pcmcia_socket_class = {
 	.name = "pcmcia_socket",
+        .hotplug = pcmcia_socket_hotplug,
 	.release = pcmcia_release_socket,
 };
 EXPORT_SYMBOL(pcmcia_socket_class);
_
