]> err.no Git - linux-2.6/blobdiff - drivers/usb/class/cdc-acm.c
Merge branch 'avr32-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemo...
[linux-2.6] / drivers / usb / class / cdc-acm.c
index b0f9873ce6b72f5f9e257edd16dfde71eeea9ae6..0147ea39340e25d38107507e31e615428f7841e4 100644 (file)
@@ -496,13 +496,10 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
           otherwise it is scheduled, and with high data rates data can get lost. */
        tty->low_latency = 1;
 
-       if (usb_autopm_get_interface(acm->control)) {
-               mutex_unlock(&open_mutex);
-               return -EIO;
-       }
+       if (usb_autopm_get_interface(acm->control) < 0)
+               goto early_bail;
 
        mutex_lock(&acm->mutex);
-       mutex_unlock(&open_mutex);
        if (acm->used++) {
                usb_autopm_put_interface(acm->control);
                goto done;
@@ -536,6 +533,7 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
 done:
 err_out:
        mutex_unlock(&acm->mutex);
+       mutex_unlock(&open_mutex);
        return rv;
 
 full_bailout:
@@ -544,6 +542,8 @@ bail_out:
        usb_autopm_put_interface(acm->control);
        acm->used--;
        mutex_unlock(&acm->mutex);
+early_bail:
+       mutex_unlock(&open_mutex);
        return -EIO;
 }
 
@@ -915,7 +915,7 @@ next_desc:
        }
        
        if (data_interface_num != call_interface_num)
-               dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.\n");
+               dev_dbg(&intf->dev,"Separate call control interface. That is not fully supported.\n");
 
 skip_normal_probe: