Commit e03a8121 authored by Sean Young's avatar Sean Young Committed by Miquel Raynal

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: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210807214538.14484-2-sean@mess.org
parent e07403a8
...@@ -720,7 +720,8 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) ...@@ -720,7 +720,8 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
{ {
struct partition *part; 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; return;
part = kzalloc(sizeof(struct partition), GFP_KERNEL); part = kzalloc(sizeof(struct partition), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment