aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2006-11-27 04:35:10 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 13:37:12 -0500
commitc578abbc20762aa58e390e55252959853eeea17e (patch)
treee8870796fae1541b7c7978d85d0ac486cd9842db
parentfbfb14455391b89edcf37327526988dea7849532 (diff)
driver core: Don't stop probing on ->probe errors.
Don't stop on the first ->probe error that is not -ENODEV/-ENXIO. There might be a driver registered returning an unresonable return code, and this stops probing completely even though it may make sense to try the next possible driver. At worst, we may end up with an unbound device. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/base/dd.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 510e7884975f..f70513748947 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -136,18 +136,17 @@ probe_failed:
136 driver_sysfs_remove(dev); 136 driver_sysfs_remove(dev);
137 dev->driver = NULL; 137 dev->driver = NULL;
138 138
139 if (ret == -ENODEV || ret == -ENXIO) { 139 if (ret != -ENODEV && ret != -ENXIO) {
140 /* Driver matched, but didn't support device
141 * or device not found.
142 * Not an error; keep going.
143 */
144 ret = 0;
145 } else {
146 /* driver matched but the probe failed */ 140 /* driver matched but the probe failed */
147 printk(KERN_WARNING 141 printk(KERN_WARNING
148 "%s: probe of %s failed with error %d\n", 142 "%s: probe of %s failed with error %d\n",
149 drv->name, dev->bus_id, ret); 143 drv->name, dev->bus_id, ret);
150 } 144 }
145 /*
146 * Ignore errors returned by ->probe so that the next driver can try
147 * its luck.
148 */
149 ret = 0;
151done: 150done:
152 kfree(data); 151 kfree(data);
153 atomic_dec(&probe_count); 152 atomic_dec(&probe_count);