Commit 5c36eb2a authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Greg Kroah-Hartman

driver-core: platform_driver_probe() must probe synchronously

Because platform_driver_probe() checks, after trying to register driver,
if there are any devices that driver successfully bound to, driver's
probe routine must be run synchronously.
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d173a137
...@@ -613,6 +613,19 @@ int __init_or_module __platform_driver_probe(struct platform_driver *drv, ...@@ -613,6 +613,19 @@ int __init_or_module __platform_driver_probe(struct platform_driver *drv,
{ {
int retval, code; int retval, code;
if (drv->driver.probe_type == PROBE_PREFER_ASYNCHRONOUS) {
pr_err("%s: drivers registered with %s can not be probed asynchronously\n",
drv->driver.name, __func__);
return -EINVAL;
}
/*
* We have to run our probes synchronously because we check if
* we find any devices to bind to and exit with error if there
* are any.
*/
drv->driver.probe_type = PROBE_FORCE_SYNCHRONOUS;
/* /*
* Prevent driver from requesting probe deferral to avoid further * Prevent driver from requesting probe deferral to avoid further
* futile probe attempts. * futile probe attempts.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment