as small as for rc5 (Re: [patch] usb-serial, ti_usb: fix usb configuration changing)[patch]

Oleg Verych <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Palacky University in Olomouc, experimental physics department.
Message-ID <[email protected]>
usb-serial, ti_usb: fix usb configuration changing

 Remove bogus error messages, comments with script.
 Use new usb-configuration interface for usb-interface drivers.

Cc: Al Borchers <[email protected]>
Signed-off-by: Oleg Verych <[email protected]>
---
On Tue, Mar 27, 2007 at 06:51:53AM -0700, Greg KH wrote:
[]
> No, it's way too late for 2.6.21 for such a large change, sorry.

  Only Magic numbers were removed.
  Return status is honored.

  Maybe this one worth being in 2.6.21-rc5-git2?
  Please, it's a little *fix*, tested, working isn't it?


> Thanks for doing this--so glad we can get rid of the hotplug
> script!
> 
> -- Al

-5/+10

Index: linux-2.6.21-rc5/drivers/usb/serial/ti_usb_3410_5052.c
===================================================================
--- linux-2.6.21-rc5.orig/drivers/usb/serial/ti_usb_3410_5052.c	2007-03-27 08:00:26.338095634 +0200
+++ linux-2.6.21-rc5/drivers/usb/serial/ti_usb_3410_5052.c	2007-03-27 08:09:36.803596727 +0200
@@ -452,11 +401,16 @@ static int ti_startup(struct usb_serial 
 		}
 
-		status = -ENODEV;
+		status = 1; /* positive status -- device to be reconfigured */
 		goto free_tdev;
-	} 
+	}
 
-	/* the second configuration must be set (in sysfs by hotplug script) */
+	/* active configuration must be set */
 	if (dev->actconfig->desc.bConfigurationValue == TI_BOOT_CONFIG) {
-		status = -ENODEV;
+		dev_info(&dev->dev, "setting configuration #%u (activating)\n",
+			 TI_ACTIVE_CONFIG);
+
+		status = usb_driver_set_configuration(dev, TI_ACTIVE_CONFIG);
+		status = status ? status: 1;
+
 		goto free_tdev;
 	}
@@ -488,5 +442,5 @@ static int ti_startup(struct usb_serial 
 		tport->tp_uart_mode = 0;	/* default is RS232 */
 	}
-	
+
 	return 0;
 
____

-------------------------------------------------------------------------
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.