Skip to content

Commit b974009

Browse files
miquelraynalgregkh
authored andcommitted
nvmem: core: Do not open-code existing functions
Use of_nvmem_layout_get_container() instead of hardcoding it. Signed-off-by: Miquel Raynal <[email protected]> Reviewed-by: Michael Walle <[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 81e1d9a commit b974009

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/nvmem/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,10 +785,10 @@ EXPORT_SYMBOL_GPL(nvmem_layout_unregister);
785785

786786
static struct nvmem_layout *nvmem_layout_get(struct nvmem_device *nvmem)
787787
{
788-
struct device_node *layout_np, *np = nvmem->dev.of_node;
788+
struct device_node *layout_np;
789789
struct nvmem_layout *l, *layout = ERR_PTR(-EPROBE_DEFER);
790790

791-
layout_np = of_get_child_by_name(np, "nvmem-layout");
791+
layout_np = of_nvmem_layout_get_container(nvmem);
792792
if (!layout_np)
793793
return NULL;
794794

0 commit comments

Comments
 (0)