aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/mediatek
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2017-07-17 14:01:19 +0800
committerStephen Boyd <sboyd@codeaurora.org>2017-07-17 18:17:28 -0700
commitfa12167cedea353e71dfb776023b84381305b4d9 (patch)
tree106d19ea27ece6fd2f0a4dc1c3858a7f995a9861 /drivers/clk/mediatek
parentdt: Add bindings for IDT VersaClock 5P49V5925 (diff)
downloadlinux-dev-fa12167cedea353e71dfb776023b84381305b4d9.tar.xz
linux-dev-fa12167cedea353e71dfb776023b84381305b4d9.zip
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>
Diffstat (limited to 'drivers/clk/mediatek')
-rw-r--r--drivers/clk/mediatek/clk-cpumux.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/clk/mediatek/clk-cpumux.c b/drivers/clk/mediatek/clk-cpumux.c
index edd8e6918050..347d7990b30f 100644
--- a/drivers/clk/mediatek/clk-cpumux.c
+++ b/drivers/clk/mediatek/clk-cpumux.c
@@ -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)
{
struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw);
- int num_parents = clk_hw_get_num_parents(hw);
unsigned int val;
regmap_read(mux->regmap, mux->reg, &val);
@@ -35,9 +34,6 @@ static u8 clk_cpumux_get_parent(struct clk_hw *hw)
val >>= mux->shift;
val &= mux->mask;
- if (val >= num_parents)
- return -EINVAL;
-
return val;
}