Skip to content

Commit

Permalink
clk: clk-prima2: fix return value check in prima2_clk_init()
Browse files Browse the repository at this point in the history
In case of error, the function clk_register() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Xu Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Barry Song <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
  • Loading branch information
ISCAS-Vulab authored and bebarino committed Oct 14, 2020
1 parent 9123e3a commit eff06bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/sirf/clk-prima2.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static void __init prima2_clk_init(struct device_node *np)

for (i = pll1; i < maxclk; i++) {
prima2_clks[i] = clk_register(NULL, prima2_clk_hw_array[i]);
BUG_ON(!prima2_clks[i]);
BUG_ON(IS_ERR(prima2_clks[i]));
}
clk_register_clkdev(prima2_clks[cpu], NULL, "cpu");
clk_register_clkdev(prima2_clks[io], NULL, "io");
Expand Down

0 comments on commit eff06bd

Please sign in to comment.