Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: sunxi: pll2: Fix return value check in sun4i_pll2_setup()

In case of error, the functions clk_register_composite() and
clk_register_divider() returns ERR_PTR() and never returns NULL.
The NULL test in the return value check should be replaced with
IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

authored by

Wei Yongjun and committed by
Maxime Ripard
7e196aa1 29b4817d

+2 -2
+2 -2
drivers/clk/sunxi/clk-a10-pll2.c
··· 73 73 SUN4I_PLL2_PRE_DIV_WIDTH, 74 74 CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO, 75 75 &sun4i_a10_pll2_lock); 76 - if (!prediv_clk) { 76 + if (IS_ERR(prediv_clk)) { 77 77 pr_err("Couldn't register the prediv clock\n"); 78 78 goto err_free_array; 79 79 } ··· 106 106 &mult->hw, &clk_multiplier_ops, 107 107 &gate->hw, &clk_gate_ops, 108 108 CLK_SET_RATE_PARENT); 109 - if (!base_clk) { 109 + if (IS_ERR(base_clk)) { 110 110 pr_err("Couldn't register the base multiplier clock\n"); 111 111 goto err_free_multiplier; 112 112 }