Revert "ALSA: usb-audio: Apply mutex around snd_usb_endpoint_set_params()"

This reverts commit 06b6de69cf which is
commit a74f8d0aa9 upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: If238e0b195375789db1828f9c3e940638f7ab2bf
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2024-05-16 10:17:18 +00:00
parent 3285ea33f4
commit 195c12ce77

View File

@@ -1343,11 +1343,10 @@ int snd_usb_endpoint_set_params(struct snd_usb_audio *chip,
const struct audioformat *fmt = ep->cur_audiofmt;
int err;
mutex_lock(&chip->mutex);
/* release old buffers, if any */
err = release_urbs(ep, false);
if (err < 0)
goto unlock;
return err;
ep->datainterval = fmt->datainterval;
ep->maxpacksize = fmt->maxpacksize;
@@ -1385,16 +1384,13 @@ int snd_usb_endpoint_set_params(struct snd_usb_audio *chip,
usb_audio_dbg(chip, "Set up %d URBS, ret=%d\n", ep->nurbs, err);
if (err < 0)
goto unlock;
return err;
/* some unit conversions in runtime */
ep->maxframesize = ep->maxpacksize / ep->cur_frame_bytes;
ep->curframesize = ep->curpacksize / ep->cur_frame_bytes;
err = update_clock_ref_rate(chip, ep);
unlock:
mutex_unlock(&chip->mutex);
return err;
return update_clock_ref_rate(chip, ep);
}
static int init_sample_rate(struct snd_usb_audio *chip,