summaryrefslogtreecommitdiff
path: root/drivers/base/dd.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2015-01-17 22:14:41 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-25 15:40:31 +0300
commitbb2b40754ff4b2fffd8015ac96c45269cb54ee79 (patch)
treefc90bd5c3971490ff783ffbb1e2c07f997307301 /drivers/base/dd.c
parentba61af6f3e4766c76aec0b5e7f2bb8277e1acdd0 (diff)
downloadlinux-bb2b40754ff4b2fffd8015ac96c45269cb54ee79.tar.xz
driver core: use *switch* statement in really_probe()
There are series of comparisons of the 'ret' variable on the failure path of really_probe(), so the *switch* statement seems more appropriate there. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/dd.c')
-rw-r--r--drivers/base/dd.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index cdc779cf79a3..bfece0c0dba3 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -320,21 +320,25 @@ probe_failed:
dev->driver = NULL;
dev_set_drvdata(dev, NULL);
- if (ret == -EPROBE_DEFER) {
+ switch (ret) {
+ case -EPROBE_DEFER:
/* Driver requested deferred probing */
dev_info(dev, "Driver %s requests probe deferral\n", drv->name);
driver_deferred_probe_add(dev);
/* Did a trigger occur while probing? Need to re-trigger if yes */
if (local_trigger_count != atomic_read(&deferred_trigger_count))
driver_deferred_probe_trigger();
- } else if (ret != -ENODEV && ret != -ENXIO) {
+ break;
+ case -ENODEV:
+ case -ENXIO:
+ pr_debug("%s: probe of %s rejects match %d\n",
+ drv->name, dev_name(dev), ret);
+ break;
+ default:
/* driver matched but the probe failed */
printk(KERN_WARNING
"%s: probe of %s failed with error %d\n",
drv->name, dev_name(dev), ret);
- } else {
- pr_debug("%s: probe of %s rejects match %d\n",
- drv->name, dev_name(dev), ret);
}
/*
* Ignore errors returned by ->probe so that the next driver can try