summaryrefslogtreecommitdiff
path: root/sound/usb/helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/helper.c')
-rw-r--r--sound/usb/helper.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/usb/helper.c b/sound/usb/helper.c
index c1db28f874c2..620902463c6e 100644
--- a/sound/usb/helper.c
+++ b/sound/usb/helper.c
@@ -86,14 +86,22 @@ int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe, __u8 request,
{
int err;
void *buf = NULL;
+ int timeout;
if (size > 0) {
buf = kmemdup(data, size, GFP_KERNEL);
if (!buf)
return -ENOMEM;
}
+
+ if (requesttype & USB_DIR_IN)
+ timeout = USB_CTRL_GET_TIMEOUT;
+ else
+ timeout = USB_CTRL_SET_TIMEOUT;
+
err = usb_control_msg(dev, pipe, request, requesttype,
- value, index, buf, size, 1000);
+ value, index, buf, size, timeout);
+
if (size > 0) {
memcpy(data, buf, size);
kfree(buf);