Skip to content

Commit 65cf20a

Browse files
morimotobebarino
authored andcommitted
clk: fixup default index for of_clk_get_by_name()
of_clk_get_by_name() is using -1 for __of_clk_get() index. It will go to of_parse_clkspec(), and be used for of_parse_phandle_with_args(). Here, if user doesn't specify clock name (= of_clk_get_by_name(np, NULL)), this index is still -1, and of_parse_phandle_with_args() will return -EINVAL (This index will be updated if if it had clock name). clk_get_by_name(np, NULL) should work, then, default index should be 0 instead of -1. This patch fixes it. Fixes: 4472287 ("clk: Introduce of_clk_get_hw_from_clkspec()") Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 5dc7e84 commit 65cf20a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/clk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4213,7 +4213,7 @@ struct clk *of_clk_get_by_name(struct device_node *np, const char *name)
42134213
if (!np)
42144214
return ERR_PTR(-ENOENT);
42154215

4216-
return __of_clk_get(np, -1, np->full_name, name);
4216+
return __of_clk_get(np, 0, np->full_name, name);
42174217
}
42184218
EXPORT_SYMBOL(of_clk_get_by_name);
42194219

0 commit comments

Comments
 (0)