summaryrefslogtreecommitdiff
path: root/drivers/clk/sunxi
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@free-electrons.com>2015-07-09 22:39:38 +0200
committerStephen Boyd <sboyd@codeaurora.org>2015-07-27 18:13:32 -0700
commit57d866e606ddf2a0cd51f7140cfd8df1fdaa48f6 (patch)
treed416f5f0399391f963b2aa4ffc03d281c3d237ad /drivers/clk/sunxi
parent0817b62cc037a56c5e4238c7eb7522299ea27aef (diff)
clk: fix some determine_rate implementations
Some determine_rate implementations are not returning an error when they failed to adapt the rate according to the rate request. Fix them so that they return an error instead of silently returning 0. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> CC: Jonathan Corbet <corbet@lwn.net> CC: Tony Lindgren <tony@atomide.com> CC: Ralf Baechle <ralf@linux-mips.org> CC: "Emilio López" <emilio@elopez.com.ar> CC: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Tero Kristo <t-kristo@ti.com> CC: Peter De Schrijver <pdeschrijver@nvidia.com> CC: Prashant Gaikwad <pgaikwad@nvidia.com> CC: Stephen Warren <swarren@wwwdotorg.org> CC: Thierry Reding <thierry.reding@gmail.com> CC: Alexandre Courbot <gnurou@gmail.com> CC: linux-doc@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org CC: linux-omap@vger.kernel.org CC: linux-mips@linux-mips.org CC: linux-tegra@vger.kernel.org Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/sunxi')
-rw-r--r--drivers/clk/sunxi/clk-factors.c6
-rw-r--r--drivers/clk/sunxi/clk-sun6i-ar100.c3
-rw-r--r--drivers/clk/sunxi/clk-sunxi.c6
3 files changed, 11 insertions, 4 deletions
diff --git a/drivers/clk/sunxi/clk-factors.c b/drivers/clk/sunxi/clk-factors.c
index 7a485870991d..94e2570a2409 100644
--- a/drivers/clk/sunxi/clk-factors.c
+++ b/drivers/clk/sunxi/clk-factors.c
@@ -107,8 +107,10 @@ static int clk_factors_determine_rate(struct clk_hw *hw,
}
}
- if (best_parent)
- req->best_parent_hw = __clk_get_hw(best_parent);
+ if (!best_parent)
+ return -EINVAL;
+
+ req->best_parent_hw = __clk_get_hw(best_parent);
req->best_parent_rate = best;
req->rate = best_child_rate;
diff --git a/drivers/clk/sunxi/clk-sun6i-ar100.c b/drivers/clk/sunxi/clk-sun6i-ar100.c
index d70c1ea345db..21b076ee59d1 100644
--- a/drivers/clk/sunxi/clk-sun6i-ar100.c
+++ b/drivers/clk/sunxi/clk-sun6i-ar100.c
@@ -105,6 +105,9 @@ static int ar100_determine_rate(struct clk_hw *hw,
}
}
+ if (best_rate < 0)
+ return best_rate;
+
req->rate = best_rate;
return 0;
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index d0f72a151bf1..0e15165280dc 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -146,8 +146,10 @@ static int sun6i_ahb1_clk_determine_rate(struct clk_hw *hw,
}
}
- if (best_parent)
- req->best_parent_hw = __clk_get_hw(best_parent);
+ if (!best_parent)
+ return -EINVAL;
+
+ req->best_parent_hw = __clk_get_hw(best_parent);
req->best_parent_rate = best;
req->rate = best_child_rate;