]> git.baikalelectronics.ru Git - kernel.git/commit
clk: fixup default index for of_clk_get_by_name()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 6 Mar 2019 07:18:28 +0000 (16:18 +0900)
committerStephen Boyd <sboyd@kernel.org>
Fri, 8 Mar 2019 18:35:07 +0000 (10:35 -0800)
commit011d42973ede8ae01a7f4cd8ce5118a3817f5c58
tree6238204d4be32a531b5ef22e8ffcd7a3fe2d898d
parent40975430a904a2468d45d7e5690e78a45323872c
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: 6799ab932382 ("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>
drivers/clk/clk.c