summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2002-10-17 21:23:30 -0700
committerPatrick Mochel <mochel@osdl.org>2002-10-17 21:23:30 -0700
commit91cfad75250ff827389f735565673c8e45df3f52 (patch)
treed487691da9d2350a0c271ca56a64236cfcd3666b /drivers
parentcdca2b1ca897470af06970ee5ad0f9270d5cb16d (diff)
driver model: make sure we only try to bind drivers to devices that don't have a driver.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/bus.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index e87a9e825a86..49683a1d3898 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -148,8 +148,10 @@ static int driver_attach(struct device_driver * drv)
list_for_each(entry,&bus->devices) {
struct device * dev = container_of(entry,struct device,bus_list);
if (get_device(dev)) {
- if (!bus_match(dev,drv) && dev->driver)
- devclass_add_device(dev);
+ if (!dev->driver) {
+ if (!bus_match(dev,drv) && dev->driver)
+ devclass_add_device(dev);
+ }
put_device(dev);
}
}