ALSA: usb-audio: Correct the return code from snd_usb_endpoint_set_params()

snd_usb_endpoint_set_params() should return zero for a success, but
currently it returns the sample rate.  Correct it.

Fixes: 2be79d5864 ("ALSA: usb-audio: Split endpoint setups for hw_params and prepare (take#2)")
Link: https://lore.kernel.org/r/20221009104212.18877-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2022-10-09 12:42:11 +02:00
parent a74f8d0aa9
commit 9355b60e40
1 changed files with 2 additions and 0 deletions

View File

@ -1386,6 +1386,8 @@ int snd_usb_endpoint_set_params(struct snd_usb_audio *chip,
ep->curframesize = ep->curpacksize / ep->cur_frame_bytes;
err = update_clock_ref_rate(chip, ep);
if (err >= 0)
err = 0;
unlock:
mutex_unlock(&chip->mutex);
return err;