diff options
author | Ming Lei <ming.lei@canonical.com> | 2012-11-19 10:35:17 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-17 16:02:11 -0500 |
commit | 190888ac01d059e38ffe77a2291d44cafa9016fb (patch) | |
tree | 600544c901338319afc04edde2aba8813a5564db /drivers/base | |
parent | 1884bd4b1461d16d10ab4ab4d19725b4e0717f7a (diff) |
driver core: fix possible missing of device probe
Inside bus_add_driver(), one device might be added(device_add()) into
the bus or probed which is triggered by deferred probe
just after completing of driver_attach() and before
'klist_add_tail(&priv->knode_bus, &bus->p->klist_drivers)',
so the device won't be probed by this driver.
This patch moves the below line
'klist_add_tail(&priv->knode_bus, &bus->p->klist_drivers)'
before driver_attach() inside bus_add_driver() to fix the
problem.
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 24eb07868344..f9d31320bd37 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -700,12 +700,12 @@ int bus_add_driver(struct device_driver *drv) | |||
700 | if (error) | 700 | if (error) |
701 | goto out_unregister; | 701 | goto out_unregister; |
702 | 702 | ||
703 | klist_add_tail(&priv->knode_bus, &bus->p->klist_drivers); | ||
703 | if (drv->bus->p->drivers_autoprobe) { | 704 | if (drv->bus->p->drivers_autoprobe) { |
704 | error = driver_attach(drv); | 705 | error = driver_attach(drv); |
705 | if (error) | 706 | if (error) |
706 | goto out_unregister; | 707 | goto out_unregister; |
707 | } | 708 | } |
708 | klist_add_tail(&priv->knode_bus, &bus->p->klist_drivers); | ||
709 | module_add_driver(drv->owner, drv); | 709 | module_add_driver(drv->owner, drv); |
710 | 710 | ||
711 | error = driver_create_file(drv, &driver_attr_uevent); | 711 | error = driver_create_file(drv, &driver_attr_uevent); |