Driver of a power domain provider may not be ready at the time of of_genpd_add_subdomain() invocation. Make this function to return -EPROBE_DEFER instead of -ENOENT in order to remove a need from power domain drivers to handle the error code specially. Tested-by: Peter Geis <pgwipeout@xxxxxxxxx> Tested-by: Nicolas Chauvet <kwizart@xxxxxxxxx> Tested-by: Matt Merhar <mattmerhar@xxxxxxxxxxxxxx> [tested on NVIDIA Tegra20/30/124 SoCs] Suggested-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx> Reviewed-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx> Reviewed-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx> Signed-off-by: Dmitry Osipenko <digetx@xxxxxxxxx> --- drivers/base/power/domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 5c843772f7f4..25b346bb2d97 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2466,7 +2466,7 @@ int of_genpd_add_subdomain(struct of_phandle_args *parent_spec, out: mutex_unlock(&gpd_list_lock); - return ret; + return ret == -ENOENT ? -EPROBE_DEFER : ret; } EXPORT_SYMBOL_GPL(of_genpd_add_subdomain); -- 2.29.2