diff options
Diffstat (limited to 'drivers/nvmem/core.c')
-rw-r--r-- | drivers/nvmem/core.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 5b3955ad40..608b352a7d 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -941,7 +941,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) nvmem->nkeepout = config->nkeepout; if (config->of_node) nvmem->dev.of_node = config->of_node; - else if (!config->no_of_node) + else nvmem->dev.of_node = config->dev->of_node; switch (config->id) { @@ -1003,9 +1003,11 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) if (rval) goto err_remove_cells; - rval = nvmem_add_cells_from_legacy_of(nvmem); - if (rval) - goto err_remove_cells; + if (config->add_legacy_fixed_of_cells) { + rval = nvmem_add_cells_from_legacy_of(nvmem); + if (rval) + goto err_remove_cells; + } rval = nvmem_add_cells_from_fixed_layout(nvmem); if (rval) |