mtd/drivers/mtd/maps physmap.c,1.19,1.20
Marius Groeger
mag at infradead.org
Tue Apr 30 05:14:52 EDT 2002
Update of /home/cvs/mtd/drivers/mtd/maps
In directory phoenix.infradead.org:/tmp/cvs-serv6706
Modified Files:
physmap.c
Log Message:
Add support for command line partitions
Index: physmap.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/physmap.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- physmap.c 21 Feb 2002 08:26:59 -0000 1.19
+++ physmap.c 30 Apr 2002 09:14:50 -0000 1.20
@@ -12,6 +12,9 @@
#include <linux/mtd/map.h>
#include <linux/config.h>
+#ifdef CONFIG_MTD_PARTITIONS
+#include <linux/mtd/partitions.h>
+#endif
#define WINDOW_ADDR CONFIG_MTD_PHYSMAP_START
#define WINDOW_SIZE CONFIG_MTD_PHYSMAP_LEN
@@ -97,6 +100,13 @@
copy_to: physmap_copy_to
};
+#ifdef CONFIG_MTD_PARTITIONS
+#ifdef CONFIG_MTD_CMDLINE_PARTS
+static struct mtd_partition *mtd_parts = 0;
+static int mtd_parts_nb = 0;
+#endif
+#endif
+
int __init init_physmap(void)
{
static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", 0 };
@@ -119,6 +129,18 @@
mymtd->module = THIS_MODULE;
add_mtd_device(mymtd);
+#ifdef CONFIG_MTD_PARTITIONS
+#ifdef CONFIG_MTD_CMDLINE_PARTS
+ mtd_parts_nb = parse_cmdline_partitions(mymtd, &mtd_parts,
+ "phys");
+ if (mtd_parts_nb > 0)
+ {
+ printk(KERN_NOTICE
+ "Using command line partition definition\n");
+ add_mtd_partitions (mymtd, mtd_parts, mtd_parts_nb);
+ }
+#endif
+#endif
return 0;
}
More information about the linux-mtd-cvs
mailing list