1 --- a/drivers/mtd/mtdcore.c
2 +++ b/drivers/mtd/mtdcore.c
4 #include <linux/backing-dev.h>
6 #include <linux/slab.h>
7 +#include <linux/root_dev.h>
9 #include <linux/mtd/mtd.h>
10 #include <linux/mtd/partitions.h>
11 @@ -422,6 +423,15 @@ int add_mtd_device(struct mtd_info *mtd)
12 of this try_ nonsense, and no bitching about it
14 __module_get(THIS_MODULE);
16 + if (!strcmp(mtd->name, "rootfs") &&
17 + config_enabled(CONFIG_MTD_ROOTFS_ROOT_DEV) &&
19 + pr_notice("mtd: device %d (%s) set to be root filesystem\n",
20 + mtd->index, mtd->name);
21 + ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, mtd->index);