Re: [patch 03/05] ti_usb, device setup: without any artificial errors, use configuration changing

Greg KH <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Fri, Feb 23, 2007 at 06:34:11AM +0100, Oleg Verych wrote:
> pp-by: Oleg Verych

Please provide a better description of what the patch does.  The
 Subject: isn't very descriptive.

> ---
>  i.e. no more uGLYdev with sysfs
> 
>  Alan, i'm looking forward to deal with this crutch :-E
> 
>  drivers/usb/serial/ti_usb_3410_5052.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6.21-rc1/drivers/usb/serial/ti_usb_3410_5052.c
> ===================================================================
> --- linux-2.6.21-rc1.orig/drivers/usb/serial/ti_usb_3410_5052.c	2007-02-23 05:03:57.691537658 +0100
> +++ linux-2.6.21-rc1/drivers/usb/serial/ti_usb_3410_5052.c	2007-02-23 05:22:22.766512292 +0100
> @@ -389,13 +389,13 @@
>  			usb_reset_device(dev);
>  		}
>  
> -		status = -ENODEV;
> +		status = 0x01E; /* positive status -- device to be reconfigured */
>  		goto free_tdev;
>  	}
>  
> -	/* the second configuration must be set (in sysfs by hotplug script) */
>  	if (dev->actconfig->desc.bConfigurationValue == TI_BOOT_CONFIG) {
> -		status = -ENODEV;
> +		(void) usb_driver_set_configuration(dev, TI_ACTIVE_CONFIG);

Don't cast function return values.  If the function requires you to
check the return value, then CHECK IT!!!

thanks,

greg k-h

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.