[PATCH] driver:core: no need to invert the return value of the call_driver_probe()

Lizhe posted 1 patch 1 year, 7 months ago
There is a newer version of this series
drivers/base/dd.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
[PATCH] driver:core: no need to invert the return value of the call_driver_probe()
Posted by Lizhe 1 year, 7 months ago
If drv->probe() or drv->bus->probe() returns EPROBE_DEFER,
then there is no need to invert the sign. Similarly,
if it returns -EPROBE_DEFER, no sign inversion is needed either

In the probe function (either bus->probe() or drv->probe()),
there is no return value of EPROBE_DEFER.

Signed-off-by: Lizhe <sensor1010@163.com>
---
 drivers/base/dd.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 83d352394fdf..d047919d1f5e 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -664,11 +664,6 @@ static int really_probe(struct device *dev, struct device_driver *drv)
 		if (link_ret == -EAGAIN)
 			ret = -EPROBE_DEFER;
 
-		/*
-		 * Return probe errors as positive values so that the callers
-		 * can distinguish them from other errors.
-		 */
-		ret = -ret;
 		goto probe_failed;
 	}
 
@@ -826,7 +821,7 @@ static int driver_probe_device(struct device_driver *drv, struct device *dev)
 
 	atomic_inc(&probe_count);
 	ret = __driver_probe_device(drv, dev);
-	if (ret == -EPROBE_DEFER || ret == EPROBE_DEFER) {
+	if (ret == -EPROBE_DEFER) {
 		driver_deferred_probe_add(dev);
 
 		/*
-- 
2.17.1