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>
This commit is contained in:
parent
fbfb144553
commit
c578abbc20
1 changed files with 6 additions and 7 deletions
|
@ -136,18 +136,17 @@ static int really_probe(void *void_data)
|
||||||
driver_sysfs_remove(dev);
|
driver_sysfs_remove(dev);
|
||||||
dev->driver = NULL;
|
dev->driver = NULL;
|
||||||
|
|
||||||
if (ret == -ENODEV || ret == -ENXIO) {
|
if (ret != -ENODEV && ret != -ENXIO) {
|
||||||
/* Driver matched, but didn't support device
|
|
||||||
* or device not found.
|
|
||||||
* Not an error; keep going.
|
|
||||||
*/
|
|
||||||
ret = 0;
|
|
||||||
} else {
|
|
||||||
/* driver matched but the probe failed */
|
/* driver matched but the probe failed */
|
||||||
printk(KERN_WARNING
|
printk(KERN_WARNING
|
||||||
"%s: probe of %s failed with error %d\n",
|
"%s: probe of %s failed with error %d\n",
|
||||||
drv->name, dev->bus_id, ret);
|
drv->name, dev->bus_id, ret);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* Ignore errors returned by ->probe so that the next driver can try
|
||||||
|
* its luck.
|
||||||
|
*/
|
||||||
|
ret = 0;
|
||||||
done:
|
done:
|
||||||
kfree(data);
|
kfree(data);
|
||||||
atomic_dec(&probe_count);
|
atomic_dec(&probe_count);
|
||||||
|
|
Loading…
Reference in a new issue