aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/quirks.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2020-11-23 09:53:36 +0100
committerTakashi Iwai <tiwai@suse.de>2020-11-23 15:16:04 +0100
commit6aa719d15a1903eb3fd0e052ae53f3b024ad4d05 (patch)
tree026ff7427535388baf0850e848991c535c3bb0a1 /sound/usb/quirks.c
parentALSA: usb-audio: Refactoring endpoint URB deactivation (diff)
downloadlinux-dev-6aa719d15a1903eb3fd0e052ae53f3b024ad4d05.tar.xz
linux-dev-6aa719d15a1903eb3fd0e052ae53f3b024ad4d05.zip
ALSA: usb-audio: Drop unneeded snd_usb_substream fields
Some fields like interface and alt_idx in snd_usb_substream are mostly useless now as they can be referred via either cur_audiofmt or data_endpoint assigned to the substream. Drop those, and also assure the concurrency about the access of cur_audiofmt field. Tested-by: Keith Milner <kamilner@superlative.org> Tested-by: Dylan Robinson <dylan_robinson@motu.com> Link: https://lore.kernel.org/r/20201123085347.19667-31-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to '')
-rw-r--r--sound/usb/quirks.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 5510c8a98447..02f3f6ed9390 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1424,7 +1424,7 @@ static void set_format_emu_quirk(struct snd_usb_substream *subs,
* by playback substream
*/
if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) {
- if (subs->stream->substream[SNDRV_PCM_STREAM_CAPTURE].interface != -1)
+ if (subs->stream->substream[SNDRV_PCM_STREAM_CAPTURE].cur_audiofmt)
return;
}
@@ -1459,13 +1459,13 @@ static void set_format_emu_quirk(struct snd_usb_substream *subs,
*/
static int pioneer_djm_set_format_quirk(struct snd_usb_substream *subs)
{
-
+ unsigned int cur_rate = subs->data_endpoint->cur_rate;
/* Convert sample rate value to little endian */
u8 sr[3];
- sr[0] = subs->cur_rate & 0xff;
- sr[1] = (subs->cur_rate >> 8) & 0xff;
- sr[2] = (subs->cur_rate >> 16) & 0xff;
+ sr[0] = cur_rate & 0xff;
+ sr[1] = (cur_rate >> 8) & 0xff;
+ sr[2] = (cur_rate >> 16) & 0xff;
/* Configure device */
usb_set_interface(subs->dev, 0, 1);