mtd/drivers/mtd/maps amd76xrom.c,1.16,1.17 ichxrom.c,1.13,1.14

ebiederman at lnxi.com ebiederman at lnxi.com
Fri Sep 17 21:59:59 EDT 2004


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

Modified Files:
	amd76xrom.c ichxrom.c 
Log Message:
- More error handling for ichxrom and amd76xrom


Index: amd76xrom.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/amd76xrom.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- amd76xrom.c	17 Sep 2004 11:45:06 -0000	1.16
+++ amd76xrom.c	18 Sep 2004 01:59:56 -0000	1.17
@@ -144,7 +144,8 @@
 	/* For write accesses caches are useless */
 	window->virt = ioremap_nocache(window->phys, window->size);
 	if (!window->virt) {
-		printk(KERN_ERR MOD_NAME ": Failed to ioremap\n");
+		printk(KERN_ERR MOD_NAME ": ioremap(%08lx, %08lx) failed\n",
+			window->phys, window->size);
 		goto out;
 	}
 
@@ -241,7 +242,11 @@
 		
 		/* Now that the mtd devices is complete claim and export it */
 		map->mtd->owner = THIS_MODULE;
-		add_mtd_device(map->mtd);
+		if (add_mtd_device(map->mtd)) {
+			map_destroy(map->mtd);
+			map->mtd = 0;
+			goto out;
+		}
 
 
 		/* Calculate the new value of map_top */

Index: ichxrom.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/ichxrom.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ichxrom.c	17 Sep 2004 11:45:06 -0000	1.13
+++ ichxrom.c	18 Sep 2004 01:59:56 -0000	1.14
@@ -289,7 +289,11 @@
 		
 		/* Now that the mtd devices is complete claim and export it */
 		map->mtd->owner = THIS_MODULE;
-		add_mtd_device(map->mtd);
+		if (add_mtd_device(map->mtd)) {
+			map_destroy(map->mtd);
+			map->mtd = 0;
+			goto out;
+		}
 
 
 		/* Calculate the new value of map_top */
@@ -311,7 +315,6 @@
 		return -ENODEV;
 	}
 	return 0;
-
 }
 
 





More information about the linux-mtd-cvs mailing list