Commit fa12167c authored by Sean Wang's avatar Sean Wang Committed by Stephen Boyd

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: 1e17de90 ("clk: mediatek: add missing cpu mux causing Mediatek cpufreq can't work")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 3a11c661
...@@ -27,7 +27,6 @@ static inline struct mtk_clk_cpumux *to_mtk_clk_cpumux(struct clk_hw *_hw) ...@@ -27,7 +27,6 @@ static inline struct mtk_clk_cpumux *to_mtk_clk_cpumux(struct clk_hw *_hw)
static u8 clk_cpumux_get_parent(struct clk_hw *hw) static u8 clk_cpumux_get_parent(struct clk_hw *hw)
{ {
struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw); struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw);
int num_parents = clk_hw_get_num_parents(hw);
unsigned int val; unsigned int val;
regmap_read(mux->regmap, mux->reg, &val); regmap_read(mux->regmap, mux->reg, &val);
...@@ -35,9 +34,6 @@ static u8 clk_cpumux_get_parent(struct clk_hw *hw) ...@@ -35,9 +34,6 @@ static u8 clk_cpumux_get_parent(struct clk_hw *hw)
val >>= mux->shift; val >>= mux->shift;
val &= mux->mask; val &= mux->mask;
if (val >= num_parents)
return -EINVAL;
return val; return val;
} }
......
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