Message ID | 20230307192536.470997-1-miquel.raynal@bootlin.com |
---|---|
State | Accepted |
Headers | show |
Series | mtd: Avoid magic values | expand |
Am 2023-03-07 20:25, schrieb Miquel Raynal: > Nvmem producer config ID "-1" is actually defined, so use the > definition > rather than hardcoding it with a magic value. > > Suggested-by: Michael Walle <michael@walle.cc> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Michael Walle <michael@walle.cc> -michael
On Tue, 2023-03-07 at 19:25:36 UTC, Miquel Raynal wrote: > Nvmem producer config ID "-1" is actually defined, so use the definition > rather than hardcoding it with a magic value. > > Suggested-by: Michael Walle <michael@walle.cc> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> > Reviewed-by: Michael Walle <michael@walle.cc> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next. Miquel
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index e4e102585021..3f6fc45be1d2 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -519,7 +519,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd) struct device_node *node = mtd_get_of_node(mtd); struct nvmem_config config = {}; - config.id = -1; + config.id = NVMEM_DEVID_NONE; config.dev = &mtd->dev; config.name = dev_name(&mtd->dev); config.owner = THIS_MODULE;
Nvmem producer config ID "-1" is actually defined, so use the definition rather than hardcoding it with a magic value. Suggested-by: Michael Walle <michael@walle.cc> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> --- drivers/mtd/mtdcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)