[PATCH 3/14] pcmcia: hotplug event for PCMCIA socket devices
Dominik Brodowski
linux at dominikbrodowski.net
Sun Feb 27 05:11:24 EST 2005
Generate hotplug event for PCMCIA sockets being registered.
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.de>
Index: 2.6.11-rc5/drivers/pcmcia/cs.c
===================================================================
--- 2.6.11-rc5.orig/drivers/pcmcia/cs.c 2005-02-26 18:38:11.000000000 +0100
+++ 2.6.11-rc5/drivers/pcmcia/cs.c 2005-02-26 22:42:36.000000000 +0100
@@ -1850,6 +1850,21 @@
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 @@
struct class pcmcia_socket_class = {
.name = "pcmcia_socket",
+ .hotplug = pcmcia_socket_hotplug,
.release = pcmcia_release_socket,
};
EXPORT_SYMBOL(pcmcia_socket_class);
More information about the linux-pcmcia
mailing list