public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] driver:core: no need to invert the return value of the call_driver_probe()
@ 2024-07-08 13:40 Lizhe
  2024-07-08 13:57 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Lizhe @ 2024-07-08 13:40 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.
v2:
        Delete the judgment with the return value of EPROBEDEFER
        from the _driver_probe.device()
v1:
        Add the judgment with the return value of EPROBEDEFER
        from the _driver_probe.device()

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


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

* Re: [PATCH v2] driver:core: no need to invert the return value of the call_driver_probe()
  2024-07-08 13:40 [PATCH v2] driver:core: no need to invert the return value of the call_driver_probe() Lizhe
@ 2024-07-08 13:57 ` Greg KH
       [not found]   ` <38a8f6da.ae7e.19097de3e54.Coremail.sensor1010@163.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2024-07-08 13:57 UTC (permalink / raw)
  To: Lizhe; +Cc: rafael, linux-kernel

On Mon, Jul 08, 2024 at 06:40:28AM -0700, Lizhe wrote:
> 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.
> v2:
>         Delete the judgment with the return value of EPROBEDEFER
>         from the _driver_probe.device()
> v1:
>         Add the judgment with the return value of EPROBEDEFER
>         from the _driver_probe.device()

Versions go below the --- line as the documentation says.

> Signed-off-by: Lizhe <sensor1010@163.com>

Full name?

thanks,

greg k-h

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

* Re: Re: [PATCH v2] driver:core: no need to invert the return value of the call_driver_probe()
       [not found]   ` <38a8f6da.ae7e.19097de3e54.Coremail.sensor1010@163.com>
@ 2024-07-09 14:26     ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2024-07-09 14:26 UTC (permalink / raw)
  To: lizhe; +Cc: rafael, linux-kernel

On Tue, Jul 09, 2024 at 10:20:42PM +0800, lizhe wrote:
> 
> 
> 
> Hi, Greg KH
> 
> 
> 
> 
> have already submitted the third version. My name is 李哲. In pinyin, it's Lizhe, and my email is sensor1010@163.com

Why not just use "李哲"?  No reason we can't use the proper
representation of your name in the changelog, right?

thanks,

greg k-h

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-08 13:40 [PATCH v2] driver:core: no need to invert the return value of the call_driver_probe() Lizhe
2024-07-08 13:57 ` Greg KH
     [not found]   ` <38a8f6da.ae7e.19097de3e54.Coremail.sensor1010@163.com>
2024-07-09 14:26     ` Greg KH

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