ASoC: SOF: pcm: Reverse check for prepared stream in sof_pcm_hw_params()
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Thu, 19 Jun 2025 10:45:51 +0000 (13:45 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 19 Jun 2025 23:21:16 +0000 (00:21 +0100)
commit3d77763c9a6d94ebc258183583891fdf23599a18
treefb4ba6c717a2a8b8bde091fa36a81c9a59c77280
parent6b3cb7f4341cbf62d41ccf6ea906dbe66be8aa3d
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>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20250619104551.25912-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/pcm.c