summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-03-08 15:02:45 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-03-11 08:31:09 +0100
commitec896c46b78234fb2b88f14be46af728024282bd (patch)
tree082e23800253f1574bfa34a424bdd2b0899c0cdb /drivers
parent369d39adfe79334db5ed04d6f2acaf096c68b8a2 (diff)
downloadbarebox-ec896c46b78234fb2b88f14be46af728024282bd.tar.gz
clk: clk-composite: return parent_rate if no rate clk
When a composite clock has no rate clock then it should output the parents rate. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/clk-composite.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index 5d21a0e..716f680 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -54,7 +54,10 @@ static unsigned long clk_composite_recalc_rate(struct clk *clk,
struct clk_composite *composite = to_clk_composite(clk);
struct clk *rate_clk = composite->rate_clk;
- return rate_clk ? rate_clk->ops->recalc_rate(rate_clk, parent_rate) : 0;
+ if (rate_clk)
+ return rate_clk->ops->recalc_rate(rate_clk, parent_rate);
+
+ return parent_rate;
}
static long clk_composite_round_rate(struct clk *clk, unsigned long rate,