mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 01:26:42 +07:00
ALSA: pcm: Use the common error path in __snd_pcm_lib_xfer()
An open-coded error path in __snd_pcm_lib_xfer() can be replaced with the simple goto to the common error path. This also makes the error handling more consistent, i.e. when some samples have been already processed, return that size instead of the error code. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
2dee43ec3f
commit
315d9f1bee
@ -2219,9 +2219,8 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
|
||||
if (frames > cont)
|
||||
frames = cont;
|
||||
if (snd_BUG_ON(!frames)) {
|
||||
runtime->twake = 0;
|
||||
snd_pcm_stream_unlock_irq(substream);
|
||||
return -EINVAL;
|
||||
err = -EINVAL;
|
||||
goto _end_unlock;
|
||||
}
|
||||
snd_pcm_stream_unlock_irq(substream);
|
||||
err = writer(substream, appl_ofs, data, offset, frames,
|
||||
|
Loading…
Reference in New Issue
Block a user