clk: ccf: mux: change the get_rate helper
authorDario Binacchi <dariobin@libero.it>
Wed, 3 Jun 2020 13:36:25 +0000 (15:36 +0200)
committerLukasz Majewski <lukma@denx.de>
Mon, 24 Aug 2020 09:03:26 +0000 (11:03 +0200)
commit12d152620d9de9ea966e1136b7f48f641c981bac
treeae79e25d72749366f6f39d49c47594168f37722b
parente3b5d74c778a8782f763412679ca4c3cb2d496c3
clk: ccf: mux: change the get_rate helper

The previous version of the get_rate helper does not work if the mux
clock parent is changed after the probe. This error has not been
detected because this condition has not been tested. The error occurs
because the set_parent helper does not change the parent of the clock
device but only the clock selection register. Since changing the parent
of a probed device can be tricky, the new version of the get_rate helper
provides the rate of the selected clock and not that of the parent.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
drivers/clk/clk-mux.c
test/dm/clk_ccf.c