summaryrefslogtreecommitdiff
path: root/sound/usb/clock.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2013-01-31 21:39:17 +0100
committerClemens Ladisch <clemens@ladisch.de>2013-06-27 21:59:47 +0200
commit8f898e92aea2c24c7f379ee265d178f69ebb9c07 (patch)
tree6877a827d7541f0a3c779cd298bd65a69c550e06 /sound/usb/clock.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/clock.c')
-rw-r--r--sound/usb/clock.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/usb/clock.c b/sound/usb/clock.c
index 3a2ce390e278..86f80c60b21f 100644
--- a/sound/usb/clock.c
+++ b/sound/usb/clock.c
@@ -407,9 +407,7 @@ int snd_usb_init_sample_rate(struct snd_usb_audio *chip, int iface,
struct usb_host_interface *alts,
struct audioformat *fmt, int rate)
{
- struct usb_interface_descriptor *altsd = get_iface_desc(alts);
-
- switch (altsd->bInterfaceProtocol) {
+ switch (fmt->protocol) {
case UAC_VERSION_1:
default:
return set_sample_rate_v1(chip, iface, alts, fmt, rate);