summaryrefslogtreecommitdiff
path: root/drivers/base/dd.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-02-12 21:28:39 -0600
committerKumar Gala <galak@kernel.crashing.org>2007-02-12 21:28:39 -0600
commit67c2b7d9d224232ee730b9c9444abed824b62e7a (patch)
tree61a48c2e3562f8f66c04fd02691390dec96466e1 /drivers/base/dd.c
parent49baa91d6863df480fa05eb57524a274f77fa886 (diff)
parent5986a2ec35836a878350c54af4bd91b1de6abc59 (diff)
Merge branch 'master' into 83xx
Diffstat (limited to 'drivers/base/dd.c')
-rw-r--r--drivers/base/dd.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 510e7884975f..b5bf243d9cd6 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -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);