diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2013-02-01 00:39:17 +0400 |
---|---|---|
committer | Clemens Ladisch <clemens@ladisch.de> | 2013-06-27 23:59:47 +0400 |
commit | 8f898e92aea2c24c7f379ee265d178f69ebb9c07 (patch) | |
tree | 6877a827d7541f0a3c779cd298bd65a69c550e06 /sound/usb/stream.c | |
parent | f722406faae2d073cc1d01063d1123c35425939e (diff) | |
download | linux-8f898e92aea2c24c7f379ee265d178f69ebb9c07.tar.xz |
ALSA: usb-audio: store protocol version in struct audioformat
Instead of reading bInterfaceProtocol from the descriptor whenever it's
needed, store this value in the audioformat structure. Besides
simplifying some code, this will allow us to correctly handle vendor-
specific devices where the descriptors are marked with other values.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/usb/stream.c')
-rw-r--r-- | sound/usb/stream.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/usb/stream.c b/sound/usb/stream.c index 7db2f8958e79..1ea5871cb980 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -635,6 +635,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; 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->channels = num_channels; if (snd_usb_get_speed(dev) == USB_SPEED_HIGH) @@ -676,7 +677,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) } /* ok, let's parse further... */ - if (snd_usb_parse_audio_format(chip, fp, format, fmt, stream, alts) < 0) { + if (snd_usb_parse_audio_format(chip, fp, format, fmt, stream) < 0) { kfree(fp->rate_table); kfree(fp->chmap); kfree(fp); |