Skip to content

Commit

Permalink
driver core: Remove driver_deferred_probe_check_state_continue()
Browse files Browse the repository at this point in the history
Now that driver_deferred_probe_check_state() works better, and
we've converted the only user of
driver_deferred_probe_check_state_continue() we can simply
remove it and simplify some of the logic.

Cc: linux-pm@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Saravana Kannan <saravanak@google.com>
Cc: Todd Kjos <tkjos@google.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Kevin Hilman <khilman@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Rob Herring <robh@kernel.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Link: https://lore.kernel.org/r/20200225050828.56458-5-john.stultz@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
John Stultz authored and Greg Kroah-Hartman committed Mar 4, 2020
1 parent bec6c0e commit 0e9f8d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 46 deletions.
53 changes: 8 additions & 45 deletions drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,19 +244,6 @@ static int __init deferred_probe_timeout_setup(char *str)
}
__setup("deferred_probe_timeout=", deferred_probe_timeout_setup);

static int __driver_deferred_probe_check_state(struct device *dev)
{
if (!IS_ENABLED(CONFIG_MODULES) && initcalls_done)
return -ENODEV;

if (!deferred_probe_timeout) {
dev_WARN(dev, "deferred probe timeout, ignoring dependency");
return -ETIMEDOUT;
}

return -EPROBE_DEFER;
}

/**
* driver_deferred_probe_check_state() - Check deferred probe state
* @dev: device to check
Expand All @@ -272,39 +259,15 @@ static int __driver_deferred_probe_check_state(struct device *dev)
*/
int driver_deferred_probe_check_state(struct device *dev)
{
int ret;

ret = __driver_deferred_probe_check_state(dev);
if (ret != -ENODEV)
return ret;

dev_warn(dev, "ignoring dependency for device, assuming no driver");

return -ENODEV;
}

/**
* driver_deferred_probe_check_state_continue() - check deferred probe state
* @dev: device to check
*
* Returns -ETIMEDOUT if deferred probe debug timeout has expired, or
* -EPROBE_DEFER otherwise.
*
* Drivers or subsystems can opt-in to calling this function instead of
* directly returning -EPROBE_DEFER.
*
* This is similar to driver_deferred_probe_check_state(), but it allows the
* subsystem to keep deferring probe after built-in drivers have had a chance
* to probe. One scenario where that is useful is if built-in drivers rely on
* resources that are provided by modular drivers.
*/
int driver_deferred_probe_check_state_continue(struct device *dev)
{
int ret;
if (!IS_ENABLED(CONFIG_MODULES) && initcalls_done) {
dev_warn(dev, "ignoring dependency for device, assuming no driver");
return -ENODEV;
}

ret = __driver_deferred_probe_check_state(dev);
if (ret != -ENODEV)
return ret;
if (!deferred_probe_timeout) {
dev_WARN(dev, "deferred probe timeout, ignoring dependency");
return -ETIMEDOUT;
}

return -EPROBE_DEFER;
}
Expand Down
1 change: 0 additions & 1 deletion include/linux/device/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ driver_find_device_by_acpi_dev(struct device_driver *drv, const void *adev)

void driver_deferred_probe_add(struct device *dev);
int driver_deferred_probe_check_state(struct device *dev);
int driver_deferred_probe_check_state_continue(struct device *dev);
void driver_init(void);

/**
Expand Down

0 comments on commit 0e9f8d0

Please sign in to comment.