speedtch.c |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)


diff -Nru a/drivers/usb/misc/speedtch.c b/drivers/usb/misc/speedtch.c
--- a/drivers/usb/misc/speedtch.c       Wed Mar 26 18:02:57 2003
+++ b/drivers/usb/misc/speedtch.c       Wed Mar 26 18:02:57 2003
@@ -1034,6 +1034,23 @@
 **  USB  **
 **********/
 
+static int udsl_set_alternate (struct udsl_instance_data *instance)
+{
+       down (&instance->serialize); /* vs self */
+       if (!instance->firmware_loaded) {
+               int ret;
+
+               if ((ret = usb_set_interface (instance->usb_dev, 1, 1)) < 0) {
+                       up (&instance->serialize);
+                       return ret;
+               }
+               instance->firmware_loaded = 1;
+       }
+       up (&instance->serialize);
+       udsl_fire_receivers (instance);
+       return 0;
+}
+
 static int udsl_usb_ioctl (struct usb_interface *intf, unsigned int code, void 
*user_data)
 {
        struct udsl_instance_data *instance = usb_get_intfdata (intf);
@@ -1048,14 +1065,7 @@
        switch (code) {
        case UDSL_IOCTL_START:
                instance->atm_dev->signal = ATM_PHY_SIG_FOUND;
-               down (&instance->serialize); /* vs self */
-               if (!instance->firmware_loaded) {
-                       usb_set_interface (instance->usb_dev, 1, 1);
-                       instance->firmware_loaded = 1;
-               }
-               up (&instance->serialize);
-               udsl_fire_receivers (instance);
-               return 0;
+               return udsl_set_alternate (instance);
        case UDSL_IOCTL_STOP:
                instance->atm_dev->signal = ATM_PHY_SIG_LOST;
                return 0;



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to