[PATCH] pcmcia: fix 'rmmod pcmcia' with unbound devices
authorDaniel Ritz <daniel.ritz-ml@swissonline.ch>
Sun, 19 Nov 2006 06:19:34 +0000 (22:19 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Mon, 20 Nov 2006 17:42:05 +0000 (09:42 -0800)
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>
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>
drivers/pcmcia/ds.c

index 0f701921c13e6e9a781844597380416d19c87c26..a20d84d707d9bff7a264fa4646fa31aa4cb31cc7 100644 (file)
@@ -1271,6 +1271,9 @@ 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 */
+       pcmcia_card_remove(socket, NULL);
+
        pcmcia_put_socket(socket);
 
        return;