Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235319
b: refs/heads/master
c: 5b7c117
h: refs/heads/master
i:
  235317: ad263f1
  235315: ca9b8ba
  235311: 22cee55
v: v3
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Feb 17, 2011
1 parent d1bc3b4 commit dcd8884
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9a91aedca2f4ef24344b7cd8f56570e620fbe4d5
refs/heads/master: 5b7c1178eb94f31a0199c3b361722775c54a8db3
16 changes: 12 additions & 4 deletions trunk/drivers/usb/serial/sierra.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,10 @@ static int sierra_send_setup(struct usb_serial_port *port)
if (!do_send)
return 0;

usb_autopm_get_interface(serial->interface);
retval = usb_autopm_get_interface(serial->interface);
if (retval < 0)
return retval;

retval = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
0x22, 0x21, val, interface, NULL, 0, USB_CTRL_SET_TIMEOUT);
usb_autopm_put_interface(serial->interface);
Expand Down Expand Up @@ -808,8 +811,12 @@ static void sierra_close(struct usb_serial_port *port)
mutex_lock(&serial->disc_mutex);
if (!serial->disconnected) {
serial->interface->needs_remote_wakeup = 0;
usb_autopm_get_interface(serial->interface);
sierra_send_setup(port);
/* odd error handling due to pm counters */
if (!usb_autopm_get_interface(serial->interface))
sierra_send_setup(port);
else
usb_autopm_get_interface_no_resume(serial->interface);

}
mutex_unlock(&serial->disc_mutex);
spin_lock_irq(&intfdata->susp_lock);
Expand Down Expand Up @@ -862,7 +869,8 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)
/* get rid of everything as in close */
sierra_close(port);
/* restore balance for autopm */
usb_autopm_put_interface(serial->interface);
if (!serial->disconnected)
usb_autopm_put_interface(serial->interface);
return err;
}
sierra_send_setup(port);
Expand Down

0 comments on commit dcd8884

Please sign in to comment.