summaryrefslogtreecommitdiff
path: root/drivers/base/base.h
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2009-07-30 23:27:18 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 20:50:46 +0400
commit2023c610dc54a4f4130b0494309a9bd668ca3df8 (patch)
tree2ffc4b19491df0f6131905d22bbb05c517a8c24c /drivers/base/base.h
parent18240904960a39e582ced8ba8ececb10b8c22dd3 (diff)
downloadlinux-2023c610dc54a4f4130b0494309a9bd668ca3df8.tar.xz
Driver core: add new device to bus's list before probing
This patch (as1271) affects when new devices get linked into their bus's list of devices. Currently this happens after probing, and it doesn't happen at all if probing fails. Clearly this is wrong, because at that point quite a few symbolic links have already been created in sysfs. We are committed to adding the device, so it should be linked into the bus's list regardless. In addition, this needs to happen before the uevent announcing the new device gets issued. Otherwise user programs might try to access the device before it has been added to the bus. To fix both these problems, the patch moves the call to klist_add_tail() forward from bus_attach_device() to bus_add_device(). Since bus_attach_device() now does nothing but probe for drivers, it has been renamed to bus_probe_device(). And lastly, the kerneldoc is updated. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/base.h')
-rw-r--r--drivers/base/base.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h
index b528145a078f..1e52c125f437 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -104,7 +104,7 @@ extern int system_bus_init(void);
extern int cpu_dev_init(void);
extern int bus_add_device(struct device *dev);
-extern void bus_attach_device(struct device *dev);
+extern void bus_probe_device(struct device *dev);
extern void bus_remove_device(struct device *dev);
extern int bus_add_driver(struct device_driver *drv);