FROMLIST: clk: fix inconsistent use of req_rate
authorHeiko Stuebner <heiko@sntech.de>
Mon, 2 May 2016 16:36:20 +0000 (18:36 +0200)
committerGerrit Code Review <gerrit@rock-chips.com>
Tue, 10 May 2016 11:11:09 +0000 (19:11 +0800)
commitdd7fe1d5e1b1d5d9c66246f51aad0fdd072d7401
tree478451244e2b06aaca61b91af1ee023dc4f2eb33
parent0bc13c72ec0596a0928485d66631c16f1a091af4
FROMLIST: clk: fix inconsistent use of req_rate

The req_rate property seems to be made to hold the rate requested through
clk_set_rate. Currently it gets initialized in clk_init to the clocks
current rate and then adapted in clk_set_rate calls. Orphan clocks and
their children get initialized to a rate of 0 and req_rate never gets
re-set when these lose their orphan-status.

Initializing req_rate to the clocks rate also is unintuitive as it just
copies the value that is already in the rate property and also looses the
information if a component actually requested a specific rate.

So separate the requested rate and only set it in clk_core_set_rate_nolock
when a real rate gets requested. The users of the req_rate __clk_put and
clk_set_rate_range that adjust a clock based on that value use req_rate
at first and fall back to rate if no rate had been requested now.

(am from https://patchwork.kernel.org/patch/8993751/)

Change-Id: I9e345e1e9d0c101d5c3c7064b6c2d2724f9eac4f
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
drivers/clk/clk.c