aboutsummaryrefslogtreecommitdiff
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorHeiner Kallweit2017-12-15 14:06:06 +0000
committerGreg Kroah-Hartman2017-12-19 10:39:33 +0100
commitfc2f997035fef8463abcf8a0a1f3d92c7c6fdf0a (patch)
tree600ff1298e22e0bb6d08e92323cf3b19933caa35 /drivers/nvmem
parent99897efd5aa0e9671946297ede45840bc2052c07 (diff)
nvmem: core: switch to device_property_present for reading property "read-only"
Switch to more generic device_property_present to consider also non-DT properties. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/core.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 4f37c9f3d120..35a3dbeea324 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -444,7 +444,6 @@ static int nvmem_setup_compat(struct nvmem_device *nvmem,
struct nvmem_device *nvmem_register(const struct nvmem_config *config)
{
struct nvmem_device *nvmem;
- struct device_node *np;
int rval;
if (!config->dev)
@@ -473,13 +472,12 @@ 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;
- nvmem->dev.of_node = np;
+ nvmem->dev.of_node = config->dev->of_node;
dev_set_name(&nvmem->dev, "%s%d",
config->name ? : "nvmem",
config->name ? config->id : nvmem->id);
- nvmem->read_only = of_property_read_bool(np, "read-only") |
+ nvmem->read_only = device_property_present(config->dev, "read-only") |
config->read_only;
if (config->root_only)