linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] clk: imx: scu: remove the calling of device_is_bound
@ 2020-11-19 11:43 Dong Aisheng
  2020-11-19 13:08 ` Sudip Mukherjee
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Dong Aisheng @ 2020-11-19 11:43 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-arm-kernel, linux-imx, Dong Aisheng, Shawn Guo,
	Sascha Hauer, Stephen Boyd, Sudip Mukherjee

The device_is_bound() is unvisable to drivers when built as modules.
It's also not aimed to be used by drivers according to Greg K.H.
Let's remove it from clk-scu driver and find another way to do proper
driver loading sequence.

Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Stephen Boyd <sboyd@kernel.org>
Fixes: 77d8f3068c63 ("clk: imx: scu: add two cells binding support")
Reported-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
 drivers/clk/imx/clk-scu.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index d10f60e48ece..1f5518b7ab39 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -153,7 +153,6 @@ static inline struct clk_scu *to_clk_scu(struct clk_hw *hw)
 
 int imx_clk_scu_init(struct device_node *np)
 {
-	struct platform_device *pd_dev;
 	u32 clk_cells;
 	int ret, i;
 
@@ -166,17 +165,11 @@ int imx_clk_scu_init(struct device_node *np)
 	if (clk_cells == 2) {
 		for (i = 0; i < IMX_SC_R_LAST; i++)
 			INIT_LIST_HEAD(&imx_scu_clks[i]);
-		/*
-		 * Note: SCU clock driver depends on SCU power domain to be ready
-		 * first. As there're no power domains under scu clock node in dts,
-		 * we can't use PROBE_DEFER automatically.
-		 */
+
+		/* pd_np will be used to attach power domains later */
 		pd_np = of_find_compatible_node(NULL, NULL, "fsl,scu-pd");
-		pd_dev = of_find_device_by_node(pd_np);
-		if (!pd_dev || !device_is_bound(&pd_dev->dev)) {
-			of_node_put(pd_np);
-			return -EPROBE_DEFER;
-		}
+		if (!pd_np)
+			return -EINVAL;
 	}
 
 	return platform_driver_register(&imx_clk_scu_driver);
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-30 13:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-19 11:43 [PATCH 1/1] clk: imx: scu: remove the calling of device_is_bound Dong Aisheng
2020-11-19 13:08 ` Sudip Mukherjee
2020-11-19 15:30   ` Aisheng Dong
2020-11-19 17:44     ` Sudip Mukherjee
2020-11-24 10:28       ` Aisheng Dong
2020-11-24 10:33 ` Aisheng Dong
2020-11-30 13:54 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).