summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2021-08-07 22:45:34 +0100
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-08-17 18:42:57 +0200
commite03a81213a9c9dd4f4f45c09a777323dff84827f (patch)
tree200ee33a6136243fb5ef91e59e831b67f502f7a9
parente07403a8c6be01857ff75060b2df9a1aa8320fe5 (diff)
downloadlinux-e03a81213a9c9dd4f4f45c09a777323dff84827f.tar.gz
linux-e03a81213a9c9dd4f4f45c09a777323dff84827f.tar.bz2
linux-e03a81213a9c9dd4f4f45c09a777323dff84827f.zip
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 <sean@mess.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210807214538.14484-2-sean@mess.org
-rw-r--r--drivers/mtd/rfd_ftl.c3
1 files changed, 2 insertions, 1 deletions
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);