projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5cab061
)
mtd: Avoid magic values
author
Miquel Raynal
<miquel.raynal@bootlin.com>
Tue, 7 Mar 2023 19:25:36 +0000
(20:25 +0100)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Wed, 8 Mar 2023 14:03:53 +0000
(15:03 +0100)
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
drivers/mtd/mtdcore.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/mtdcore.c
b/drivers/mtd/mtdcore.c
index 83fb7192a593cebf996e150375e46dae47c48d31..c78f9f4d522cf68f6974c1283cc5f4cf47501c1a 100644
(file)
--- 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;