aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-06-27 19:28:05 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 21:03:06 -0400
commit3ee13937525f6044d769b1a84d5db5669ac1959e (patch)
tree5323526999e6c739ae453340492b1c95fdcccc7a /drivers/pcmcia
parent840c2ac5d3c1d50e8a181e3f661da814e89c8cf8 (diff)
[PATCH] pcmcia: hotplug event for PCMCIA socket devices
Generate hotplug event for PCMCIA sockets being registered. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/cs.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 48e4f04530d8..fec9e0304738 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -1866,6 +1866,21 @@ int pcmcia_insert_card(struct pcmcia_socket *skt)
1866 return ret; 1866 return ret;
1867} /* insert_card */ 1867} /* insert_card */
1868 1868
1869static int pcmcia_socket_hotplug(struct class_device *dev, char **envp,
1870 int num_envp, char *buffer, int buffer_size)
1871{
1872 struct pcmcia_socket *s = container_of(dev, struct pcmcia_socket, dev);
1873 int i = 0, length = 0;
1874
1875 if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size,
1876 &length, "SOCKET_NO=%u", s->sock))
1877 return -ENOMEM;
1878
1879 envp[i] = NULL;
1880
1881 return 0;
1882}
1883
1869/*====================================================================== 1884/*======================================================================
1870 1885
1871 OS-specific module glue goes here 1886 OS-specific module glue goes here
@@ -1895,6 +1910,7 @@ EXPORT_SYMBOL(pcmcia_parse_events);
1895 1910
1896struct class pcmcia_socket_class = { 1911struct class pcmcia_socket_class = {
1897 .name = "pcmcia_socket", 1912 .name = "pcmcia_socket",
1913 .hotplug = pcmcia_socket_hotplug,
1898 .release = pcmcia_release_socket, 1914 .release = pcmcia_release_socket,
1899}; 1915};
1900EXPORT_SYMBOL(pcmcia_socket_class); 1916EXPORT_SYMBOL(pcmcia_socket_class);