Skip to content

Commit f4cf4e5

Browse files
Rafał Miłeckigregkh
authored andcommitted
Revert "nvmem: add new config option"
This reverts commit 517f14d. Config option "no_of_node" is no longer needed since adding a more explicit and targeted option "add_legacy_fixed_of_cells". That "no_of_node" config option was needed *earlier* to help mtd's case. DT nodes of MTD partitions (that are also NVMEM devices) may contain subnodes. Those SHOULD NOT be treated as NVMEM fixed cells. To prevent NVMEM core code from parsing subnodes a "no_of_node" option was added (and set to true in mtd) to make for_each_child_of_node() in NVMEM a no-op. That was a bit hacky because it was messing with "of_node" pointer to achieve some side-effect. 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 <[email protected]> Reviewed-by: Miquel Raynal <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 61e54de commit f4cf4e5

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
@@ -560,7 +560,6 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
560560
config.read_only = true;
561561
config.root_only = true;
562562
config.ignore_wp = true;
563-
config.no_of_node = !of_device_is_compatible(node, "nvmem-cells");
564563
config.priv = mtd;
565564

566565
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
@@ -89,7 +89,6 @@ struct nvmem_cell_info {
8989
* @read_only: Device is read-only.
9090
* @root_only: Device is accessibly to root only.
9191
* @of_node: If given, this will be used instead of the parent's of_node.
92-
* @no_of_node: Device should not use the parent's of_node even if it's !NULL.
9392
* @reg_read: Callback to read data.
9493
* @reg_write: Callback to write data.
9594
* @size: Device size.
@@ -122,7 +121,6 @@ struct nvmem_config {
122121
bool ignore_wp;
123122
struct nvmem_layout *layout;
124123
struct device_node *of_node;
125-
bool no_of_node;
126124
nvmem_reg_read_t reg_read;
127125
nvmem_reg_write_t reg_write;
128126
int size;

0 commit comments

Comments
 (0)