Message ID | 20200220050440.45878-4-john.stultz@linaro.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | driver core: Try to improve and cleanup driver_deferred_probe_check_state() | expand |
On Thu, Feb 20, 2020 at 6:05 AM John Stultz <john.stultz@linaro.org> wrote: > With the earlier sanity fixes to > driver_deferred_probe_check_state() it should be usable for the > pinctrl logic here. > > So tweak the logic to use driver_deferred_probe_check_state() > instead of driver_deferred_probe_check_state_continue() > > Cc: Rob Herring <robh@kernel.org> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> > Cc: Kevin Hilman <khilman@kernel.org> > Cc: Ulf Hansson <ulf.hansson@linaro.org> > Cc: Pavel Machek <pavel@ucw.cz> > Cc: Len Brown <len.brown@intel.com> > Cc: Todd Kjos <tkjos@google.com> > Cc: Bjorn Andersson <bjorn.andersson@linaro.org> > Cc: Liam Girdwood <lgirdwood@gmail.com> > Cc: Mark Brown <broonie@kernel.org> > Cc: Thierry Reding <treding@nvidia.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: linux-pm@vger.kernel.org > Signed-off-by: John Stultz <john.stultz@linaro.org> > Change-Id: If72682e0a7641b33edf56f188fc067c68bbc571e I sure trust that you know what you're doing here. Acked-by: Linus Walleij <linus.walleij@linaro.org> I assume you will merge this through device core? Yours, Linus Walleij
On Fri, Feb 21, 2020 at 7:22 AM Linus Walleij <linus.walleij@linaro.org> wrote: > On Thu, Feb 20, 2020 at 6:05 AM John Stultz <john.stultz@linaro.org> wrote: > > > With the earlier sanity fixes to > > driver_deferred_probe_check_state() it should be usable for the > > pinctrl logic here. > > > > So tweak the logic to use driver_deferred_probe_check_state() > > instead of driver_deferred_probe_check_state_continue() > > > > Cc: Rob Herring <robh@kernel.org> > > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> > > Cc: Kevin Hilman <khilman@kernel.org> > > Cc: Ulf Hansson <ulf.hansson@linaro.org> > > Cc: Pavel Machek <pavel@ucw.cz> > > Cc: Len Brown <len.brown@intel.com> > > Cc: Todd Kjos <tkjos@google.com> > > Cc: Bjorn Andersson <bjorn.andersson@linaro.org> > > Cc: Liam Girdwood <lgirdwood@gmail.com> > > Cc: Mark Brown <broonie@kernel.org> > > Cc: Thierry Reding <treding@nvidia.com> > > Cc: Linus Walleij <linus.walleij@linaro.org> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > Cc: linux-pm@vger.kernel.org > > Signed-off-by: John Stultz <john.stultz@linaro.org> > > Change-Id: If72682e0a7641b33edf56f188fc067c68bbc571e > > I sure trust that you know what you're doing here. Classic mistake. :) > Acked-by: Linus Walleij <linus.walleij@linaro.org> > > I assume you will merge this through device core? I guess? I'm going to resend it again as I think its a reasonable cleanup, but the urgent need for it from me may be solved by of_devlink Saravana's patch instead. thanks -john
diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index 9357f7c46cf3..1ed20ac2243f 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c @@ -127,11 +127,12 @@ static int dt_to_map_one_config(struct pinctrl *p, np_pctldev = of_get_next_parent(np_pctldev); if (!np_pctldev || of_node_is_root(np_pctldev)) { of_node_put(np_pctldev); + ret = driver_deferred_probe_check_state(p->dev); /* keep deferring if modules are enabled unless we've timed out */ - if (IS_ENABLED(CONFIG_MODULES) && !allow_default) - return driver_deferred_probe_check_state_continue(p->dev); - - return driver_deferred_probe_check_state(p->dev); + if (IS_ENABLED(CONFIG_MODULES) && !allow_default && + (ret == -ENODEV)) + ret = -EPROBE_DEFER; + return ret; } /* If we're creating a hog we can use the passed pctldev */ if (hog_pctldev && (np_pctldev == p->dev->of_node)) {
With the earlier sanity fixes to driver_deferred_probe_check_state() it should be usable for the pinctrl logic here. So tweak the logic to use driver_deferred_probe_check_state() instead of driver_deferred_probe_check_state_continue() Cc: Rob Herring <robh@kernel.org> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Kevin Hilman <khilman@kernel.org> Cc: Ulf Hansson <ulf.hansson@linaro.org> Cc: Pavel Machek <pavel@ucw.cz> Cc: Len Brown <len.brown@intel.com> Cc: Todd Kjos <tkjos@google.com> Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Thierry Reding <treding@nvidia.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-pm@vger.kernel.org Signed-off-by: John Stultz <john.stultz@linaro.org> Change-Id: If72682e0a7641b33edf56f188fc067c68bbc571e --- drivers/pinctrl/devicetree.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)