]> git.baikalelectronics.ru Git - uboot.git/commit
clk: ccf: correct the test on the parent uclass in clk_enable/clk_disable
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Mon, 24 Jan 2022 13:17:14 +0000 (14:17 +0100)
committerSean Anderson <seanga2@gmail.com>
Fri, 25 Feb 2022 06:41:04 +0000 (01:41 -0500)
commit3c988e81220023439f0a89a826493ec0251d30b5
tree3446e3d4eabf01f039cc57b4ea566b1cb9b1e07b
parent5afe68734c3ca580818cc70d5448f6b845d50c28
clk: ccf: correct the test on the parent uclass in clk_enable/clk_disable

It is safe to check if the uclass id on the device is UCLASS_CLK
before to call the clk_ functions, but today this comparison is
not done on the device used in API: clkp->dev->parent
but on the device himself: clkp->dev.

This patch corrects this behavior and tests if the parent device
is a clock device before to call the clock API, clk_enable or
clk_disable, on this device.

Fixes: 885bbfa08df6 ("clk: prograte clk enable/disable to parent")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
drivers/clk/clk-uclass.c