diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-11-08 08:52:07 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-11-10 08:53:44 +0100 |
commit | bd516e38dd1490cb83b58f8f7914912f3a702978 (patch) | |
tree | 293c007512bb7465b82b884e334b8a71c7155f71 /drivers/clk | |
parent | bddbf8dfc9ffd286ba7d19502e21f47c61df8fe2 (diff) | |
download | barebox-bd516e38dd1490cb83b58f8f7914912f3a702978.tar.gz barebox-bd516e38dd1490cb83b58f8f7914912f3a702978.tar.xz |
clk: handle CLK_OF_DECLARE in deep probe
An assigned-clock-parents referring to a fixed-clock will result in a
warning:
WARNING: clk: couldn't get parent clock 0 for /ethernet@fe300000
That's because the device for the fixed clock is created on demand and
even after ensuring probe, no driver will have bound against it as
CLK_OF_DECLARE operates outside the driver model.
Fix this by creating devices and binding the dummy driver while
iterating over the CLK_OF_DECLARE list. No functional change for
systems not enabling deep-probe.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211108075209.2366770-7-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/clk.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index fff1e21144..189c9c62df 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -845,9 +845,15 @@ int of_clk_init(struct device_node *root, const struct of_device_id *matches) struct device_node *np = clk_provider->np; if (force || parent_ready(np)) { + struct device_d *dev; of_pinctrl_select_state_default(np); - clk_provider->clk_init_cb(np); + + dev = of_device_create_on_demand(np); + + if (clk_provider->clk_init_cb(np) == 0 && dev) + of_platform_device_dummy_drv(dev); + of_clk_set_defaults(np, true); list_del(&clk_provider->node); |