summaryrefslogtreecommitdiffstats
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2023-08-23 15:27:43 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-23 16:34:02 +0200
commitb97400912a08dae6c1c1779a05157f2ab0180f4f (patch)
treeddc5ec3a60b354fe11c4dcb3f44eb822d9364ed2 /drivers/nvmem
parentnvmem: core: Return NULL when no nvmem layout is found (diff)
downloadlinux-b97400912a08dae6c1c1779a05157f2ab0180f4f.tar.xz
linux-b97400912a08dae6c1c1779a05157f2ab0180f4f.zip
nvmem: core: Do not open-code existing functions
Use of_nvmem_layout_get_container() instead of hardcoding it. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Michael Walle <michael@walle.cc> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230823132744.350618-22-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index bc7ea001a446..12d05aea0b41 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -785,10 +785,10 @@ EXPORT_SYMBOL_GPL(nvmem_layout_unregister);
static struct nvmem_layout *nvmem_layout_get(struct nvmem_device *nvmem)
{
- struct device_node *layout_np, *np = nvmem->dev.of_node;
+ struct device_node *layout_np;
struct nvmem_layout *l, *layout = ERR_PTR(-EPROBE_DEFER);
- layout_np = of_get_child_by_name(np, "nvmem-layout");
+ layout_np = of_nvmem_layout_get_container(nvmem);
if (!layout_np)
return NULL;