Skip to content

Commit 75f32f4

Browse files
committed
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 <michael@walle.cc> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Michael Walle <michael@walle.cc> Link: https://lore.kernel.org/linux-mtd/20230307192536.470997-1-miquel.raynal@bootlin.com
1 parent 5cab061 commit 75f32f4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mtd/mtdcore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
519519
struct device_node *node = mtd_get_of_node(mtd);
520520
struct nvmem_config config = {};
521521

522-
config.id = -1;
522+
config.id = NVMEM_DEVID_NONE;
523523
config.dev = &mtd->dev;
524524
config.name = dev_name(&mtd->dev);
525525
config.owner = THIS_MODULE;

0 commit comments

Comments
 (0)