clk: Move rate and accuracy recalc to mostly consumer APIs
authorStephen Boyd <sboyd@kernel.org>
Wed, 5 Feb 2020 23:28:01 +0000 (15:28 -0800)
committerStephen Boyd <sboyd@kernel.org>
Wed, 12 Feb 2020 23:27:11 +0000 (15:27 -0800)
commit0daa376d832f4ce585f153efee4233b52fa3fe58
tree4b352a2fed2d72ea72eee48c808e91422cfd1e8a
parent768a5d4f63c29d3bed5abb3c187312fcf623fa05
clk: Move rate and accuracy recalc to mostly consumer APIs

There's some confusion about when recalc is done for the rate and
accuracy clk consumer APIs in relation to the prepare lock being taken.
Oddly enough, we take the lock again in debugfs APIs so that we can call
the internal "clk_core" APIs to get these fields with any necessary
recalculations. Instead of having this confusion, let's introduce a
recalc variant of these two consumer APIs as internal helpers and call
them from the consumer APIs and the debugfs code so that we don't take
the lock more than once.

Cc: Douglas Anderson <dianders@chromium.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20200205232802.29184-4-sboyd@kernel.org
Acked-by: Jerome Brunet <jbrunet@baylibre.com>
drivers/clk/clk.c