summaryrefslogtreecommitdiffstats
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
authorDmitry Torokhov2015-03-31 01:20:07 +0200
committerGreg Kroah-Hartman2015-05-20 09:25:25 +0200
commit5c36eb2a9ecc0bc5228451b1eeb83e70b6bb7473 (patch)
tree5d5f051418a625460526c6c4128944697bbd247a /drivers/base/platform.c
parentdriver-core: enable drivers to opt-out of async probe (diff)
downloadkernel-qcow2-linux-5c36eb2a9ecc0bc5228451b1eeb83e70b6bb7473.tar.gz
kernel-qcow2-linux-5c36eb2a9ecc0bc5228451b1eeb83e70b6bb7473.tar.xz
kernel-qcow2-linux-5c36eb2a9ecc0bc5228451b1eeb83e70b6bb7473.zip
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: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r--drivers/base/platform.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index ebf034b97278..063f0ab15259 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -613,6 +613,19 @@ int __init_or_module __platform_driver_probe(struct platform_driver *drv,
{
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
* futile probe attempts.