diff mbox series

[RFC,4/6] mtd: blkdevs: set GENHD_FL_NO_NVMEM

Message ID 65171d5da3daba24315ecdfef6727442baae5bbf.1689802933.git.daniel@makrotopia.org (mailing list archive)
State New, archived
Headers show
Series nvmem: add block device NVMEM provider | expand

Commit Message

Daniel Golle July 19, 2023, 10:03 p.m. UTC
As the MTD subsystem already acts as an NVMEM provider, emulated mtdblock
devices should not be considered NVMEM providers.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 drivers/mtd/mtd_blkdevs.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Miquel Raynal July 20, 2023, 6:04 a.m. UTC | #1
Hi Daniel,

daniel@makrotopia.org wrote on Wed, 19 Jul 2023 23:03:24 +0100:

> As the MTD subsystem already acts as an NVMEM provider, emulated mtdblock
> devices should not be considered NVMEM providers.
> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
>  drivers/mtd/mtd_blkdevs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
> index ff18636e08897..82d5afba6a25a 100644
> --- a/drivers/mtd/mtd_blkdevs.c
> +++ b/drivers/mtd/mtd_blkdevs.c
> @@ -362,6 +362,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
>  		gd->flags |= GENHD_FL_NO_PART;
>  	}
>  
> +	gd->flags |= GENHD_FL_NO_NVMEM;
>  	set_capacity(gd, ((u64)new->size * tr->blksize) >> 9);
>  
>  	/* Create the request queue */

Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl
diff mbox series

Patch

diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index ff18636e08897..82d5afba6a25a 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -362,6 +362,7 @@  int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
 		gd->flags |= GENHD_FL_NO_PART;
 	}
 
+	gd->flags |= GENHD_FL_NO_NVMEM;
 	set_capacity(gd, ((u64)new->size * tr->blksize) >> 9);
 
 	/* Create the request queue */