From e03a81213a9c9dd4f4f45c09a777323dff84827f Mon Sep 17 00:00:00 2001 From: Sean Young Date: Sat, 7 Aug 2021 22:45:34 +0100 Subject: mtd: rfd_ftl: allow use of MTD_RAM for testing purposes This allows the rfd_ftl to be used with the mtdram module, so we can test different mtd sizes and test the rfd_ftl on machines without a physical nor flash device. Signed-off-by: Sean Young Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210807214538.14484-2-sean@mess.org --- drivers/mtd/rfd_ftl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/mtd') diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c index 6e0d5ce9b010..7b243f2b2fa3 100644 --- a/drivers/mtd/rfd_ftl.c +++ b/drivers/mtd/rfd_ftl.c @@ -720,7 +720,8 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) { struct partition *part; - if (mtd->type != MTD_NORFLASH || mtd->size > UINT_MAX) + if ((mtd->type != MTD_NORFLASH && mtd->type != MTD_RAM) || + mtd->size > UINT_MAX) return; part = kzalloc(sizeof(struct partition), GFP_KERNEL); -- cgit v1.2.3-58-ga151