clk: Don't cache errors from clk_ops::get_phase()
authorStephen Boyd <sboyd@kernel.org>
Wed, 5 Feb 2020 23:27:59 +0000 (15:27 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Apr 2020 08:36:27 +0000 (10:36 +0200)
commit04e43c7c664a56dd92d1e27d8d9c4577553d5aaf
tree0e7274d8feecdadf24abfa12de5a58a29c822d71
parent83321ee302e383409172910d56533381062ff74f
clk: Don't cache errors from clk_ops::get_phase()

[ Upstream commit f21cf9c77ee82ef8adfeb2143adfacf21ec1d5cc ]

We don't check for errors from clk_ops::get_phase() before storing away
the result into the clk_core::phase member. This can lead to some fairly
confusing debugfs information if these ops do return an error. Let's
skip the store when this op fails to fix this. While we're here, move
the locking outside of clk_core_get_phase() to simplify callers from
the debugfs side.

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-2-sboyd@kernel.org
Acked-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/clk.c