summaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk.c
diff options
context:
space:
mode:
authorKuninori Morimoto2019-03-06 08:18:28 +0100
committerStephen Boyd2019-03-08 19:35:07 +0100
commit65cf20ad4f54d7feb87cda0369d6560e9789f0d5 (patch)
tree6238204d4be32a531b5ef22e8ffcd7a3fe2d898d /drivers/clk/clk.c
parentMerge branch 'clk-parent-rewrite' (early part) into clk-next (diff)
downloadkernel-qcow2-linux-65cf20ad4f54d7feb87cda0369d6560e9789f0d5.tar.gz
kernel-qcow2-linux-65cf20ad4f54d7feb87cda0369d6560e9789f0d5.tar.xz
kernel-qcow2-linux-65cf20ad4f54d7feb87cda0369d6560e9789f0d5.zip
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: 4472287a3b2f ("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>
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r--drivers/clk/clk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 14cbf239d9b2..96053a96fe2f 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -4213,7 +4213,7 @@ struct clk *of_clk_get_by_name(struct device_node *np, const char *name)
if (!np)
return ERR_PTR(-ENOENT);
- return __of_clk_get(np, -1, np->full_name, name);
+ return __of_clk_get(np, 0, np->full_name, name);
}
EXPORT_SYMBOL(of_clk_get_by_name);