Skip to content

Commit ca73843

Browse files
Rafał MiłeckiSrinivas-Kandagatla
authored andcommitted
Revert "nvmem: add new config option"
This reverts commit 517f14d. It seems that "no_of_node" config option was added to help mtd's case. DT nodes of MTD partitions (that are also NVMEM devices) may contain subnodes that SHOULD NOT be treated as NVMEM fixed cells. To prevent NVMEM core code from parsing them "no_of_node" was set to true and that made for_each_child_of_node() in NVMEM a no-op. With the introduction of "add_legacy_fixed_of_cells" config option things got more explicit. MTD subsystem simply tells NVMEM when to look for fixed cells and there is no need to hack "of_node" pointer anymore. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
1 parent 0bb80ec commit ca73843

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

drivers/mtd/mtdcore.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,6 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
559559
config.read_only = true;
560560
config.root_only = true;
561561
config.ignore_wp = true;
562-
config.no_of_node = !of_device_is_compatible(node, "nvmem-cells");
563562
config.priv = mtd;
564563

565564
mtd->nvmem = nvmem_register(&config);

drivers/nvmem/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
935935
nvmem->nkeepout = config->nkeepout;
936936
if (config->of_node)
937937
nvmem->dev.of_node = config->of_node;
938-
else if (!config->no_of_node)
938+
else
939939
nvmem->dev.of_node = config->dev->of_node;
940940

941941
switch (config->id) {

include/linux/nvmem-provider.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ struct nvmem_cell_info {
8888
* @read_only: Device is read-only.
8989
* @root_only: Device is accessibly to root only.
9090
* @of_node: If given, this will be used instead of the parent's of_node.
91-
* @no_of_node: Device should not use the parent's of_node even if it's !NULL.
9291
* @reg_read: Callback to read data.
9392
* @reg_write: Callback to write data.
9493
* @size: Device size.
@@ -120,7 +119,6 @@ struct nvmem_config {
120119
bool ignore_wp;
121120
struct nvmem_layout *layout;
122121
struct device_node *of_node;
123-
bool no_of_node;
124122
nvmem_reg_read_t reg_read;
125123
nvmem_reg_write_t reg_write;
126124
int size;

0 commit comments

Comments
 (0)