diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-07-06 08:11:43 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-07-06 08:11:43 +0200 |
commit | 9e9b594661e8dee54955607277c937c3ff3a5f01 (patch) | |
tree | 48741ea76284cd4c1b8bab3e2decd82991ea5443 /sound/usb | |
parent | 8663ff75cdca0a66f808e124c5592735793926af (diff) | |
download | talos-obmc-linux-9e9b594661e8dee54955607277c937c3ff3a5f01.tar.gz talos-obmc-linux-9e9b594661e8dee54955607277c937c3ff3a5f01.zip |
ALSA: usb-audio: Fix the first PCM interface assignment
In the new PCM streaming logic, the interface number is assigned to
usb stream instance (subs->interface) after the format and rate setups
are succeeded, but some codes are still passing subs->interface as the
reference to helper functions. This leads to initializing with an
invalid iface number (-1).
This patch replaces the wrong references with the ones from the target
fmt correctly.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/pcm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 54607f8c4f66..f0ede134a111 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -387,7 +387,7 @@ add_sync_ep: subs->data_endpoint->sync_master = subs->sync_endpoint; } - if ((err = snd_usb_init_pitch(subs->stream->chip, subs->interface, alts, fmt)) < 0) + if ((err = snd_usb_init_pitch(subs->stream->chip, fmt->iface, alts, fmt)) < 0) return err; subs->cur_audiofmt = fmt; @@ -450,7 +450,7 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream, struct usb_interface *iface; iface = usb_ifnum_to_if(subs->dev, fmt->iface); alts = &iface->altsetting[fmt->altset_idx]; - ret = snd_usb_init_sample_rate(subs->stream->chip, subs->interface, alts, fmt, rate); + ret = snd_usb_init_sample_rate(subs->stream->chip, fmt->iface, alts, fmt, rate); if (ret < 0) return ret; subs->cur_rate = rate; |