summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-06-27 16:28:54 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 18:03:20 -0700
commit378a33a686d457fa5a38d6ad134f5385a9cc7860 (patch)
treed3773b8cc8dec6580b7d2b7327766e9cd8738e5d
parent3448139b41b9e3b8799eed7d427cd50789dadc3e (diff)
downloadblackbird-op-linux-378a33a686d457fa5a38d6ad134f5385a9cc7860.tar.gz
blackbird-op-linux-378a33a686d457fa5a38d6ad134f5385a9cc7860.zip
[PATCH] pcmcia: release_class
Properly wait for the class refcount to reach zero. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/pcmcia/cs.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 0ff4d6ec8b77..e82859d3227a 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -903,17 +903,29 @@ static int pcmcia_socket_hotplug(struct class_device *dev, char **envp,
}
+static struct completion pcmcia_unload;
+
+static void pcmcia_release_socket_class(struct class *data)
+{
+ complete(&pcmcia_unload);
+}
+
+
struct class pcmcia_socket_class = {
.name = "pcmcia_socket",
.hotplug = pcmcia_socket_hotplug,
.release = pcmcia_release_socket,
+ .class_release = pcmcia_release_socket_class,
};
EXPORT_SYMBOL(pcmcia_socket_class);
static int __init init_pcmcia_cs(void)
{
- int ret = class_register(&pcmcia_socket_class);
+ int ret;
+
+ init_completion(&pcmcia_unload);
+ ret = class_register(&pcmcia_socket_class);
if (ret)
return (ret);
return class_interface_register(&pccard_sysfs_interface);
@@ -923,6 +935,8 @@ static void __exit exit_pcmcia_cs(void)
{
class_interface_unregister(&pccard_sysfs_interface);
class_unregister(&pcmcia_socket_class);
+
+ wait_for_completion(&pcmcia_unload);
}
subsys_initcall(init_pcmcia_cs);
OpenPOWER on IntegriCloud