ASoC: sof: sof-audio: use for_each_pcm_streams() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87tv3paa8i.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2020-02-17 17:28:47 +09:00 committed by Mark Brown
parent 4c260c3f19
commit 525c4107da
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 7 additions and 12 deletions

View File

@ -23,7 +23,7 @@ bool snd_sof_dsp_only_d0i3_compatible_stream_active(struct snd_sof_dev *sdev)
int dir;
list_for_each_entry(spcm, &sdev->pcm_list, list) {
for (dir = 0; dir <= SNDRV_PCM_STREAM_CAPTURE; dir++) {
for_each_pcm_streams(dir) {
substream = spcm->stream[dir].substream;
if (!substream || !substream->runtime)
continue;
@ -71,7 +71,7 @@ int sof_set_hw_params_upon_resume(struct device *dev)
* have been suspended.
*/
list_for_each_entry(spcm, &sdev->pcm_list, list) {
for (dir = 0; dir <= SNDRV_PCM_STREAM_CAPTURE; dir++) {
for_each_pcm_streams(dir) {
/*
* do not reset hw_params upon resume for streams that
* were kept running during suspend
@ -319,16 +319,11 @@ struct snd_sof_pcm *snd_sof_find_spcm_comp(struct snd_soc_component *scomp,
int dir;
list_for_each_entry(spcm, &sdev->pcm_list, list) {
dir = SNDRV_PCM_STREAM_PLAYBACK;
if (spcm->stream[dir].comp_id == comp_id) {
*direction = dir;
return spcm;
}
dir = SNDRV_PCM_STREAM_CAPTURE;
if (spcm->stream[dir].comp_id == comp_id) {
*direction = dir;
return spcm;
for_each_pcm_streams(dir) {
if (spcm->stream[dir].comp_id == comp_id) {
*direction = dir;
return spcm;
}
}
}