@@ -465,7 +465,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
nvmem->priv = config->priv;
nvmem->reg_read = config->reg_read;
nvmem->reg_write = config->reg_write;
- np = config->dev->of_node;
+ np = config->of_node ? : config->dev->of_node;
nvmem->dev.of_node = np;
dev_set_name(&nvmem->dev, "%s%d",
config->name ? : "nvmem", config->id);
@@ -21,6 +21,7 @@ typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset,
struct nvmem_config {
struct device *dev;
+ struct device_node *of_node;
const char *name;
int id;
struct module *owner;