mtd/drivers/mtd/maps pcmciamtd.c,1.51,1.52

gleixner at infradead.org gleixner at infradead.org
Thu Mar 17 15:05:40 EST 2005


Update of /home/cvs/mtd/drivers/mtd/maps
In directory phoenix.infradead.org:/tmp/cvs-serv26361

Modified Files:
	pcmciamtd.c 
Log Message:
Merge from mainstream.

[PATCH] pcmcia: remove client_attributes

Remove the "Attributes" entry of struct client_t -- _all_ in-kernel drivers
did set it to INFO_IO_CLIENT | INFO_CARD_SHARE anyway, and the pcmcia core
didn't care at all what this value was set to.

Also, remove the setting of the respective request field in all in-kernel
drivers -- the request structure is kept the same, though, to keep external
drivers compiling.

[PATCH] pcmcia: BUG on dev_list != NULL

All in-kernel PCMCIA devices do unregister their client in their respective
->detach() function after a REMOVAL event.  So, AFAICS, the dev_list iteration
should always be false.

Signed-off-by: Dominik Brodowski <linux at brodo.de>



Index: pcmciamtd.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/pcmciamtd.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- pcmciamtd.c	12 Jul 2004 22:38:29 -0000	1.51
+++ pcmciamtd.c	17 Mar 2005 20:05:37 -0000	1.52
@@ -800,7 +800,6 @@
 
 	/* Register with Card Services */
 	client_reg.dev_info = &dev_info;
-	client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
 	client_reg.EventMask =
 		CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
 		CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
@@ -854,35 +853,7 @@
 {
 	DEBUG(1, DRIVER_DESC " unloading");
 	pcmcia_unregister_driver(&pcmciamtd_driver);
-
-	while(dev_list) {
-		dev_link_t *link = dev_list;
-
-		dev_list = link->next;
-		if (link) {
-			struct pcmciamtd_dev *dev = link->priv;
-			
- 			if(dev) {
-				if(link->state & DEV_PRESENT) {
-					if (!(link->state & DEV_STALE_LINK)) {
-						pcmciamtd_detach(link);
-					}
-					link->state &= ~DEV_PRESENT;
-					if(dev->mtd_info) {
-						del_mtd_device(dev->mtd_info);
-						info("mtd%d: Removed",
-						     dev->mtd_info->index);
-					}
-				}
-				if(dev->mtd_info) {
-					DEBUG(2, "Destroying map for mtd%d",
-					      dev->mtd_info->index);
-					map_destroy(dev->mtd_info);
-				}
-				kfree(dev);
-			}
-		}
-	}
+	BUG_ON(dev_list != NULL);
 }
 
 module_init(init_pcmciamtd);





More information about the linux-mtd-cvs mailing list