mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] driver:core: no need to invert the return value of the call_driver_probe()
@ 2024-07-07 11:27 Lizhe
  2024-07-07 14:08 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Lizhe @ 2024-07-07 11:27 UTC (permalink / raw)
  To: gregkh, rafael; +Cc: linux-kernel, Lizhe

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 | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 83d352394fdf..cbf7fe6aa8e0 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;
 	}
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-07 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-07 11:27 [PATCH v1] driver:core: no need to invert the return value of the call_driver_probe() Lizhe
2024-07-07 14:08 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®