diff mbox series

[3/3] clk: imx: scu: defer probe if scu pd is still not ready

Message ID 20201124100802.22775-4-aisheng.dong@nxp.com
State New
Headers show
Series [1/3] clk: imx: scu: make scu clk driver depend on scu pd | expand

Commit Message

Aisheng Dong Nov. 24, 2020, 10:08 a.m. UTC
The clocks registered by SCU clock protocol driver requires power domain
to be ready first. Query the SCU PD status to support -EPROBE_DEFER
properly.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
 drivers/clk/imx/clk-scu.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index 1f5518b7ab39..846201f9b72d 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -163,6 +163,9 @@  int imx_clk_scu_init(struct device_node *np)
 	of_property_read_u32(np, "#clock-cells", &clk_cells);
 
 	if (clk_cells == 2) {
+		if (!imx_scu_pd_is_initialized())
+			return -EPROBE_DEFER;
+
 		for (i = 0; i < IMX_SC_R_LAST; i++)
 			INIT_LIST_HEAD(&imx_scu_clks[i]);