]> err.no Git - linux-2.6/blobdiff - drivers/base/dd.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[linux-2.6] / drivers / base / dd.c
index 510e7884975f9f4a4571dd5038ef4b7dbb090f80..b5bf243d9cd6a26afc47eabb2990cf2d4cf13884 100644 (file)
@@ -86,8 +86,12 @@ static void driver_sysfs_remove(struct device *dev)
  */
 int device_bind_driver(struct device *dev)
 {
-       driver_bound(dev);
-       return driver_sysfs_add(dev);
+       int ret;
+
+       ret = driver_sysfs_add(dev);
+       if (!ret)
+               driver_bound(dev);
+       return ret;
 }
 
 struct stupid_thread_structure {
@@ -136,18 +140,17 @@ probe_failed:
        driver_sysfs_remove(dev);
        dev->driver = NULL;
 
-       if (ret == -ENODEV || ret == -ENXIO) {
-               /* Driver matched, but didn't support device
-                * or device not found.
-                * Not an error; keep going.
-                */
-               ret = 0;
-       } else {
+       if (ret != -ENODEV && ret != -ENXIO) {
                /* driver matched but the probe failed */
                printk(KERN_WARNING
                       "%s: probe of %s failed with error %d\n",
                       drv->name, dev->bus_id, ret);
        }
+       /*
+        * Ignore errors returned by ->probe so that the next driver can try
+        * its luck.
+        */
+       ret = 0;
 done:
        kfree(data);
        atomic_dec(&probe_count);