diff options
author | Daniel Ritz <daniel.ritz-ml@swissonline.ch> | 2006-11-18 22:19:34 -0800 |
---|---|---|
committer | Chris Wright <chrisw@sous-sol.org> | 2006-12-01 16:12:36 -0800 |
commit | 159226d1940245a918b8dc8ebe65ad5827ab8f82 (patch) | |
tree | 97d34f738cb23bf626bf528a8fd7f4fe6f4ce766 /drivers | |
parent | a5812a61ad72c94afdad2aa81dda5ffa7838f3d5 (diff) |
[PATCH] pcmcia: fix 'rmmod pcmcia' with unbound devices
Having unbound PCMCIA devices: doing a 'find /sys' after a 'rmmod pcmcia'
gives an oops because the pcmcia_device is not unregisterd from the driver
core.
fixes bugzilla #7481
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Pavol Gono <Palo.Gono@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[chrisw: add subsequent mutex fix]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pcmcia/ds.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 74b3124e8247..95d5e880f8d8 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -1264,6 +1264,11 @@ static void pcmcia_bus_remove_socket(struct class_device *class_dev, socket->pcmcia_state.dead = 1; pccard_register_pcmcia(socket, NULL); + /* unregister any unbound devices */ + mutex_lock(&socket->skt_mutex); + pcmcia_card_remove(socket, NULL); + mutex_unlock(&socket->skt_mutex); + pcmcia_put_socket(socket); return; |