Skip to content

Commit 47046fc

Browse files
ujfalusiranj063
authored andcommitted
ASoC: SOF: pcm: Reverse check for prepared stream in sof_pcm_hw_params()
Reduce the number of checks needed with the simple and most common audio sequence when the stream is started then stopped. If the stream has not been prepared there is no need to check if we have pcm_ops and pcm_ops->hw_free() callback as it does not matter. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent dee6209 commit 47046fc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/soc/sof/pcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static int sof_pcm_hw_params(struct snd_soc_component *component,
159159
* Handle repeated calls to hw_params() without free_pcm() in
160160
* between. At least ALSA OSS emulation depends on this.
161161
*/
162-
if (pcm_ops && pcm_ops->hw_free && spcm->prepared[substream->stream]) {
162+
if (spcm->prepared[substream->stream] && pcm_ops && pcm_ops->hw_free) {
163163
ret = pcm_ops->hw_free(component, substream);
164164
if (ret < 0)
165165
return ret;

0 commit comments

Comments
 (0)