ASoC: Intel: catpt: Simplify catpt_stream_find()

Code line reduction and more transparent variable naming.
No functional changes.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20260603085827.1964796-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Cezary Rojewski 2026-06-03 10:58:24 +02:00 committed by Mark Brown
parent fa55ad6079
commit f40e7873cd
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -99,19 +99,15 @@ catpt_get_stream_template(struct snd_pcm_substream *substream)
}
/* Caller responsible for holding ->stream_mutex. */
struct catpt_stream_runtime *
catpt_stream_find(struct catpt_dev *cdev, u8 stream_hw_id)
struct catpt_stream_runtime *catpt_stream_find(struct catpt_dev *cdev, u8 stream_hw_id)
{
struct catpt_stream_runtime *pos, *result = NULL;
struct catpt_stream_runtime *stream;
list_for_each_entry(pos, &cdev->stream_list, node) {
if (pos->info.stream_hw_id == stream_hw_id) {
result = pos;
break;
}
}
list_for_each_entry(stream, &cdev->stream_list, node)
if (stream->info.stream_hw_id == stream_hw_id)
return stream;
return result;
return NULL;
}
/* Caller responsible for holding ->stream_mutex. */