]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clk: versatile: Remove WARNs in ->round_rate()
authorBrian Starkey <brian.starkey@arm.com>
Mon, 13 Nov 2017 15:27:51 +0000 (15:27 +0000)
committerStephen Boyd <sboyd@kernel.org>
Fri, 16 Mar 2018 22:31:16 +0000 (15:31 -0700)
clk_round_rate() is intended to be used to round a given clock rate to
the closest one achievable by the actual clock. This implies that the
input to clk_round_rate() is expected to be unachievable - and such
cases shouldn't be treated as exceptional.

To reflect this, remove the WARN_ONs which trigger when an unachievable
clock rate is passed to vexpress_osc_round_rate().

Reported-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/versatile/clk-vexpress-osc.c

index d3b5af2a02ab0d309c57a045f34382ce16f678af..dd08ecb498be289a6f23dfd7d2f309d254e6dd68 100644 (file)
@@ -44,10 +44,10 @@ static long vexpress_osc_round_rate(struct clk_hw *hw, unsigned long rate,
 {
        struct vexpress_osc *osc = to_vexpress_osc(hw);
 
-       if (WARN_ON(osc->rate_min && rate < osc->rate_min))
+       if (osc->rate_min && rate < osc->rate_min)
                rate = osc->rate_min;
 
-       if (WARN_ON(osc->rate_max && rate > osc->rate_max))
+       if (osc->rate_max && rate > osc->rate_max)
                rate = osc->rate_max;
 
        return rate;