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
This commit is contained in:
parent
5cab06156a
commit
75f32f4b9d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue