summaryrefslogtreecommitdiff
path: root/sound/usb/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/stream.c')
-rw-r--r--sound/usb/stream.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/usb/stream.c b/sound/usb/stream.c
index 5c235a5ba7e1..ec7d756d78d1 100644
--- a/sound/usb/stream.c
+++ b/sound/usb/stream.c
@@ -690,6 +690,7 @@ audio_format_alloc_init(struct snd_usb_audio *chip,
int protocol, int iface_no, int altset_idx,
int altno, int num_channels, int clock)
{
+ struct usb_host_endpoint *ep = &alts->endpoint[0];
struct audioformat *fp;
fp = kzalloc(sizeof(*fp), GFP_KERNEL);
@@ -703,11 +704,8 @@ audio_format_alloc_init(struct snd_usb_audio *chip,
fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
fp->datainterval = snd_usb_parse_datainterval(chip, alts);
fp->protocol = protocol;
- fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
+ fp->maxpacksize = usb_endpoint_max_periodic_payload(chip->dev, ep);
fp->channels = num_channels;
- if (snd_usb_get_speed(chip->dev) == USB_SPEED_HIGH)
- fp->maxpacksize = (((fp->maxpacksize >> 11) & 3) + 1)
- * (fp->maxpacksize & 0x7ff);
fp->clock = clock;
INIT_LIST_HEAD(&fp->list);