Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

driver core: Remove driver_deferred_probe_check_state_continue()

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>

authored by

John Stultz and committed by
Greg Kroah-Hartman
0e9f8d09 bec6c0ec

+8 -46
+8 -45
drivers/base/dd.c
··· 244 244 } 245 245 __setup("deferred_probe_timeout=", deferred_probe_timeout_setup); 246 246 247 - static int __driver_deferred_probe_check_state(struct device *dev) 248 - { 249 - if (!IS_ENABLED(CONFIG_MODULES) && initcalls_done) 250 - return -ENODEV; 251 - 252 - if (!deferred_probe_timeout) { 253 - dev_WARN(dev, "deferred probe timeout, ignoring dependency"); 254 - return -ETIMEDOUT; 255 - } 256 - 257 - return -EPROBE_DEFER; 258 - } 259 - 260 247 /** 261 248 * driver_deferred_probe_check_state() - Check deferred probe state 262 249 * @dev: device to check ··· 259 272 */ 260 273 int driver_deferred_probe_check_state(struct device *dev) 261 274 { 262 - int ret; 275 + if (!IS_ENABLED(CONFIG_MODULES) && initcalls_done) { 276 + dev_warn(dev, "ignoring dependency for device, assuming no driver"); 277 + return -ENODEV; 278 + } 263 279 264 - ret = __driver_deferred_probe_check_state(dev); 265 - if (ret != -ENODEV) 266 - return ret; 267 - 268 - dev_warn(dev, "ignoring dependency for device, assuming no driver"); 269 - 270 - return -ENODEV; 271 - } 272 - 273 - /** 274 - * driver_deferred_probe_check_state_continue() - check deferred probe state 275 - * @dev: device to check 276 - * 277 - * Returns -ETIMEDOUT if deferred probe debug timeout has expired, or 278 - * -EPROBE_DEFER otherwise. 279 - * 280 - * Drivers or subsystems can opt-in to calling this function instead of 281 - * directly returning -EPROBE_DEFER. 282 - * 283 - * This is similar to driver_deferred_probe_check_state(), but it allows the 284 - * subsystem to keep deferring probe after built-in drivers have had a chance 285 - * to probe. One scenario where that is useful is if built-in drivers rely on 286 - * resources that are provided by modular drivers. 287 - */ 288 - int driver_deferred_probe_check_state_continue(struct device *dev) 289 - { 290 - int ret; 291 - 292 - ret = __driver_deferred_probe_check_state(dev); 293 - if (ret != -ENODEV) 294 - return ret; 280 + if (!deferred_probe_timeout) { 281 + dev_WARN(dev, "deferred probe timeout, ignoring dependency"); 282 + return -ETIMEDOUT; 283 + } 295 284 296 285 return -EPROBE_DEFER; 297 286 }
-1
include/linux/device/driver.h
··· 238 238 239 239 void driver_deferred_probe_add(struct device *dev); 240 240 int driver_deferred_probe_check_state(struct device *dev); 241 - int driver_deferred_probe_check_state_continue(struct device *dev); 242 241 void driver_init(void); 243 242 244 243 /**