summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorAmit Nischal <anischal@codeaurora.org>2017-04-14 12:01:05 +0530
committerAmit Nischal <anischal@codeaurora.org>2017-04-20 10:05:52 +0530
commit520bcb4b2a8731571aa78cca18cc1e8560564e37 (patch)
treec8fbe8a9ce6905a3dea31172cd589d170b935b53 /drivers/clk
parent15a311d026dafc7df0402bc767bd437e2bbfb074 (diff)
clk: msm: clock-local2: Fix get_rate ops for branch clock
For branch clocks having aggr_sibling_rates flag as set, get_rate() always returns the parents rate despite the branch clocks prepare status. Fix the same by adding a check for branch prepare status and aggr_sibling_rates flag value. Change-Id: If0ba62e178f14bc5fd8ec6007a67538a9b97285b Signed-off-by: Amit Nischal <anischal@codeaurora.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/msm/clock-local2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/clk/msm/clock-local2.c b/drivers/clk/msm/clock-local2.c
index 19956f030ae9..adb07cdb7e8d 100644
--- a/drivers/clk/msm/clock-local2.c
+++ b/drivers/clk/msm/clock-local2.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -928,7 +928,8 @@ static unsigned long branch_clk_get_rate(struct clk *c)
{
struct branch_clk *branch = to_branch_clk(c);
- if (branch->max_div)
+ if (branch->max_div ||
+ (branch->aggr_sibling_rates && !branch->is_prepared))
return branch->c.rate;
return clk_get_rate(c->parent);