Give each mtd device its own backing_dev_info instance. Signed-off-by: Peter Zijlstra --- drivers/mtd/mtdcore.c | 8 +++++--- include/linux/mtd/mtd.h | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) Index: linux-2.6/drivers/mtd/mtdcore.c =================================================================== --- linux-2.6.orig/drivers/mtd/mtdcore.c +++ linux-2.6/drivers/mtd/mtdcore.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "internal.h" @@ -53,15 +54,16 @@ int add_mtd_device(struct mtd_info *mtd) if (!mtd->backing_dev_info) { switch (mtd->type) { case MTD_RAM: - mtd->backing_dev_info = &mtd_bdi_rw_mappable; + mtd->mtd_backing_dev_info = mtd_bdi_rw_mappable; break; case MTD_ROM: - mtd->backing_dev_info = &mtd_bdi_ro_mappable; + mtd->mtd_backing_dev_info = mtd_bdi_ro_mappable; break; default: - mtd->backing_dev_info = &mtd_bdi_unmappable; + mtd->mtd_backing_dev_info = mtd_bdi_unmappable; break; } + mtd->backing_dev_info = &mtd->mtd_backing_dev_info; } err = bdi_init(mtd->backing_dev_info); if (err) Index: linux-2.6/include/linux/mtd/mtd.h =================================================================== --- linux-2.6.orig/include/linux/mtd/mtd.h +++ linux-2.6/include/linux/mtd/mtd.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -154,6 +155,7 @@ struct mtd_info { * - provides mmap capabilities */ struct backing_dev_info *backing_dev_info; + struct backing_dev_info mtd_backing_dev_info; int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/