From bd516e38dd1490cb83b58f8f7914912f3a702978 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 8 Nov 2021 08:52:07 +0100 Subject: 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 Link: https://lore.barebox.org/20211108075209.2366770-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- include/of.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/of.h b/include/of.h index f9c2b283de..1b7392cdb3 100644 --- a/include/of.h +++ b/include/of.h @@ -279,6 +279,7 @@ extern struct device_d *of_device_enable_and_register_by_name(const char *name); extern struct device_d *of_device_enable_and_register_by_alias( const char *alias); +extern struct device_d *of_device_create_on_demand(struct device_node *np); extern int of_device_ensure_probed(struct device_node *np); extern int of_device_ensure_probed_by_alias(const char *alias); extern int of_devices_ensure_probed_by_property(const char *property_name); @@ -372,6 +373,11 @@ static inline void of_platform_device_dummy_drv(struct device_d *dev) { } +static inline struct device_d *of_device_create_on_demand(struct device_node *np) +{ + return NULL; +} + static inline int of_device_ensure_probed(struct device_node *np) { return 0; -- cgit v1.2.3