aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/pcm.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2013-01-31 15:39:17 -0500
committerClemens Ladisch <clemens@ladisch.de>2013-06-27 15:59:47 -0400
commit8f898e92aea2c24c7f379ee265d178f69ebb9c07 (patch)
tree6877a827d7541f0a3c779cd298bd65a69c550e06 /sound/usb/pcm.c
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
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/pcm.c')
-rw-r--r--sound/usb/pcm.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 93b6e32cfead..776c58c7cba0 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -202,13 +202,11 @@ int snd_usb_init_pitch(struct snd_usb_audio *chip, int iface,
202 struct usb_host_interface *alts, 202 struct usb_host_interface *alts,
203 struct audioformat *fmt) 203 struct audioformat *fmt)
204{ 204{
205 struct usb_interface_descriptor *altsd = get_iface_desc(alts);
206
207 /* if endpoint doesn't have pitch control, bail out */ 205 /* if endpoint doesn't have pitch control, bail out */
208 if (!(fmt->attributes & UAC_EP_CS_ATTR_PITCH_CONTROL)) 206 if (!(fmt->attributes & UAC_EP_CS_ATTR_PITCH_CONTROL))
209 return 0; 207 return 0;
210 208
211 switch (altsd->bInterfaceProtocol) { 209 switch (fmt->protocol) {
212 case UAC_VERSION_1: 210 case UAC_VERSION_1:
213 default: 211 default:
214 return init_pitch_v1(chip, iface, alts, fmt); 212 return init_pitch_v1(chip, iface, alts, fmt);