From: Miquel Raynal Date: Tue, 7 Mar 2023 19:25:36 +0000 (+0100) Subject: mtd: Avoid magic values X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=75f32f4b9d5263829d1d13f990000db929140559;p=linux.git mtd: Avoid magic values Nvmem producer config ID "-1" is actually defined, so use the definition rather than hardcoding it with a magic value. Suggested-by: Michael Walle Signed-off-by: Miquel Raynal Reviewed-by: Michael Walle Link: https://lore.kernel.org/linux-mtd/20230307192536.470997-1-miquel.raynal@bootlin.com --- diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 83fb7192a593c..c78f9f4d522cf 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;