From: Cornelia Huck Date: Mon, 27 Nov 2006 09:35:10 +0000 (+0100) Subject: driver core: Don't stop probing on ->probe errors. X-Git-Tag: v2.6.21-rc2~42^2~10^2~13 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c578abbc20762aa58e390e55252959853eeea17e;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 510e7884975..f7051374894 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -136,18 +136,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);