Commit ee85e9bd authored by Axel Lin's avatar Axel Lin Committed by Mike Turquette

clk: sunxi: Fix checking return value of clk_register_[composite|factors]

clk_register_composite() and clk_register_factors() return ERR_PTR on error.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
parent 5cfe9614
......@@ -64,7 +64,7 @@ static void __init sunxi_osc_clk_setup(struct device_node *node)
&gate->hw, &clk_gate_ops,
CLK_IS_ROOT);
if (clk) {
if (!IS_ERR(clk)) {
of_clk_add_provider(node, of_clk_src_simple_get, clk);
clk_register_clkdev(clk, clk_name, NULL);
}
......@@ -221,7 +221,7 @@ static void __init sunxi_factors_clk_setup(struct device_node *node,
clk = clk_register_factors(NULL, clk_name, parent, 0, reg,
data->table, data->getter, &clk_lock);
if (clk) {
if (!IS_ERR(clk)) {
of_clk_add_provider(node, of_clk_src_simple_get, clk);
clk_register_clkdev(clk, clk_name, NULL);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment