]> git.neil.brown.name Git - history.git/commitdiff
driver model: make sure we only try to bind drivers to devices that don't have a...
authorPatrick Mochel <mochel@osdl.org>
Fri, 18 Oct 2002 04:23:30 +0000 (21:23 -0700)
committerPatrick Mochel <mochel@osdl.org>
Fri, 18 Oct 2002 04:23:30 +0000 (21:23 -0700)
drivers/base/bus.c

index e87a9e825a86233e723b6c80e8ce61568a2fbf36..49683a1d3898778eb0cab0489e70978f3aef34f2 100644 (file)
@@ -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);
                }
        }