diff options
author | Johan Hovold <jhovold@gmail.com> | 2014-05-26 19:23:39 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2014-07-11 13:33:41 +0100 |
commit | 57eb9099f3842564bbca138d06069e5053fdb4df (patch) | |
tree | 592b1dc7bd53aa0900bc4121beb9423a951b774c /drivers | |
parent | ab05a2e4be115e07f18152b1569ae8522c4e76a3 (diff) | |
download | lwn-57eb9099f3842564bbca138d06069e5053fdb4df.tar.gz lwn-57eb9099f3842564bbca138d06069e5053fdb4df.zip |
USB: cdc-acm: fix runtime PM for control messages
commit bae3f4c53585e9a170da9436e0f06919874bda9a upstream.
Fix runtime PM handling of control messages by adding the required PM
counter operations.
Fixes: 11ea859d64b6 ("USB: additional power savings for cdc-acm devices
that support remote wakeup")
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index ea4fb1a09a68..ed988effdf07 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -72,13 +72,23 @@ static const struct tty_port_operations acm_port_ops = { static int acm_ctrl_msg(struct acm *acm, int request, int value, void *buf, int len) { - int retval = usb_control_msg(acm->dev, usb_sndctrlpipe(acm->dev, 0), + int retval; + + retval = usb_autopm_get_interface(acm->control); + if (retval) + return retval; + + retval = usb_control_msg(acm->dev, usb_sndctrlpipe(acm->dev, 0), request, USB_RT_ACM, value, acm->control->altsetting[0].desc.bInterfaceNumber, buf, len, 5000); + dev_dbg(&acm->control->dev, "%s - rq 0x%02x, val %#x, len %#x, result %d\n", __func__, request, value, len, retval); + + usb_autopm_put_interface(acm->control); + return retval < 0 ? retval : 0; } |