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

clk: mediatek: fixed static checker warning in clk_cpumux_get_parent call

Fixed the signedness bug returning '(-22)' on the return type as u8 with
removing the sanity checker in clk_cpumux_get_parent() since
clk_cpumux_set_parent() always ensures validity in clk_cpumux_get_parent()
got called.

Fixes: 1e17de9049da ("clk: mediatek: add missing cpu mux causing Mediatek cpufreq can't work")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Sean Wang and committed by
Stephen Boyd
fa12167c 3a11c661

-4
-4
drivers/clk/mediatek/clk-cpumux.c
··· 27 27 static u8 clk_cpumux_get_parent(struct clk_hw *hw) 28 28 { 29 29 struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw); 30 - int num_parents = clk_hw_get_num_parents(hw); 31 30 unsigned int val; 32 31 33 32 regmap_read(mux->regmap, mux->reg, &val); 34 33 35 34 val >>= mux->shift; 36 35 val &= mux->mask; 37 - 38 - if (val >= num_parents) 39 - return -EINVAL; 40 36 41 37 return val; 42 38 }