Re: defected usb-serial config. fix (Re: [patch 2.6.21-rc5] usb-serial, ti_usb: fix usb configuration changing)

Oleg Verych <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Palacky University in Olomouc, experimental physics department
Message-ID <[email protected]>
On Wed, Apr 04, 2007 at 03:23:14PM +0200, Oliver Neukum wrote:
> Am Mittwoch, 4. April 2007 11:02 schrieb Oleg Verych:
> > Would you like to add '-p' option to 'diff', to see a function name.
> > 
> 
> Certainly.
> 
> 	Regards
> 		Oliver
> ----
> --- a/drivers/usb/serial/usb-serial.c	2007-04-02 17:19:15.000000000 +0200
> +++ b/drivers/usb/serial/usb-serial.c	2007-04-02 17:22:20.000000000 +0200
> @@ -969,17 +969,24 @@ int usb_serial_probe(struct usb_interfac


This fix didn't get to mainline.

>  	} else if (num_interrupt_out) {
>  		dbg("the device claims to support interrupt out transfers, but write_int_callback is not defined");
>  	}
> -	
> -	/* if this device type has an attach function, call it */
> +
> +	if (get_free_serial (serial, num_ports, &minor) == NULL) {
> +		dev_err(&interface->dev, "No more free serial devices\n");
> +		goto probe_error;
> +	}
> +	serial->minor = minor;
> +
> +	/* if this device type has an attach function, call it
> +	 * now as the minors are known but the device not registered */
>  	if (type->attach) {
>  		if (!try_module_get(type->driver.owner)) {
>  			dev_err(&interface->dev, "module get failed, exiting\n");
> -			goto probe_error;
> +			goto full_error;
>  		}
>  		retval = type->attach (serial);
>  		module_put(type->driver.owner);
>  		if (retval < 0)
> -			goto probe_error;
> +			goto full_error;
>  		if (retval > 0) {
>  			/* quietly accept this device, but don't bind to a serial port
>  			 * as it's about to disappear */
> @@ -987,12 +994,6 @@ int usb_serial_probe(struct usb_interfac
>  		}
>  	}
>  
> -	if (get_free_serial (serial, num_ports, &minor) == NULL) {
> -		dev_err(&interface->dev, "No more free serial devices\n");
> -		goto probe_error;
> -	}
> -	serial->minor = minor;
> -
>  	/* register all of the individual ports with the driver core */
>  	for (i = 0; i < num_ports; ++i) {
>  		port = serial->port[i];
> @@ -1016,6 +1017,8 @@ exit:
>  	usb_set_intfdata (interface, serial);
>  	return 0;
>  
> +full_error:
> +	return_serial(serial);
>  probe_error:
>  	for (i = 0; i < num_bulk_in; ++i) {
>  		port = serial->port[i];

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[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.