Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 520bcb4b authored by Amit Nischal's avatar Amit Nischal
Browse files

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: default avatarAmit Nischal <anischal@codeaurora.org>
parent 15a311d0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
/* 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);