mtd/drivers/mtd/maps bast-flash.c,1.1,1.2
bjd at infradead.org
bjd at infradead.org
Tue Jan 18 06:13:50 EST 2005
Update of /home/cvs/mtd/drivers/mtd/maps
In directory phoenix.infradead.org:/tmp/cvs-serv2138/drivers/mtd/maps
Modified Files:
bast-flash.c
Log Message:
Ensure the whole device is added if there are no partitions found on the
device, so that at least the flash can be read/written.
Replace some of the constants with their SZ_xxx counterparts
Index: bast-flash.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/bast-flash.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- bast-flash.c 21 Sep 2004 14:29:04 -0000 1.1
+++ bast-flash.c 18 Jan 2005 11:13:47 -0000 1.2
@@ -1,12 +1,13 @@
/* linux/drivers/mtd/maps/bast_flash.c
*
- * Copyright (c) 2004 Simtec Electronics
- * Ben Dooks <ben at simtec.co.uk>
+ * Copyright (c) 2004-2005 Simtec Electronics
+ * Ben Dooks <ben at simtec.co.uk>
*
* Simtec Bast (EB2410ITX) NOR MTD Mapping driver
*
* Changelog:
* 20-Sep-2004 BJD Initial version
+ * 17-Jan-2005 BJD Add whole device if no partitions found
*
* $Id$
*
@@ -46,9 +47,9 @@
#include <asm/arch/bast-cpld.h>
#ifdef CONFIG_MTD_BAST_MAXSIZE
-#define AREA_MAXSIZE (CONFIG_MTD_BAST_MAXSIZE * (1024*1024))
+#define AREA_MAXSIZE (CONFIG_MTD_BAST_MAXSIZE * SZ_1M)
#else
-#define AREA_MAXSIZE (32*1024*1024)
+#define AREA_MAXSIZE (32 * SZ_1M)
#endif
#define PFX "bast-flash: "
@@ -189,6 +190,8 @@
err = add_mtd_partitions(info->mtd, info->partitions, err);
if (err)
printk(KERN_ERR PFX "cannot add/parse partitions\n");
+ } else {
+ err = add_mtd_device(info->mtd);
}
if (err == 0)
More information about the linux-mtd-cvs
mailing list