Subject: Re: [PATCH] Cleanup usbnet_probe() return value handling

From: David Brownell <[email-masked]>
Date: Tue, 3 Jul 2007 21:34:13 -0700

On Monday 02 July 2007, Peter Korsgaard wrote:

> usbnet_probe() handles a positive return value from the driver bind()
> function as success, but will later only setup the status handler if the
> return value was zero, leading to confusion. Patch adjusts this to accept
> positive values as success in both checks.
> 
> Signed-off-by: Peter Korsgaard <[email-masked]>

Signed-off-by: David Brownell <[email-masked]>

... though I'd adjust comments to say "non-negative" rather
than "positive".  Most folks won't say that zero is positive.

> ---
>  drivers/net/usb/usbnet.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6.22-rc7/drivers/net/usb/usbnet.c
> ===================================================================
> --- linux-2.6.22-rc7.orig/drivers/net/usb/usbnet.c
> +++ linux-2.6.22-rc7/drivers/net/usb/usbnet.c
> @@ -1208,7 +1208,7 @@
>  			status = 0;
>  
>  	}
> -	if (status == 0 && dev->status)
> +	if (status >= 0 && dev->status)
>  		status = init_status (dev, udev);
>  	if (status < 0)
>  		goto out3;
> 
> -- 
> Bye, Peter Korsgaard
>