@@ -271,18 +271,16 @@ dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes,
271271
272272 if (dev -> direction == SOF_IPC_STREAM_PLAYBACK ) {
273273#if CONFIG_IPC_MAJOR_4
274- struct list_item * sink_list ;
275274 /*
276275 * copy from local buffer to all sinks that are not gateway buffers
277276 * using the right PCM converter function.
278277 */
279- list_for_item (sink_list , & dev -> bsink_list ) {
278+ struct comp_buffer * sink ;
279+
280+ comp_dev_for_each_consumer (dev , sink ) {
280281 struct comp_dev * sink_dev ;
281- struct comp_buffer * sink ;
282282 int j ;
283283
284- sink = container_of (sink_list , struct comp_buffer , source_list );
285-
286284 if (sink == dd -> dma_buffer )
287285 continue ;
288286
@@ -321,20 +319,18 @@ dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes,
321319 ret = stream_copy_from_no_consume (dd -> dma_buffer , dd -> local_buffer ,
322320 dd -> process , bytes , dd -> chmap );
323321#if CONFIG_IPC_MAJOR_4
324- struct list_item * sink_list ;
325322 /* Skip in case of endpoint DAI devices created by the copier */
326323 if (converter ) {
327324 /*
328325 * copy from DMA buffer to all sink buffers using the right PCM converter
329326 * function
330327 */
331- list_for_item (sink_list , & dev -> bsink_list ) {
328+ struct comp_buffer * sink ;
329+
330+ comp_dev_for_each_consumer (dev , sink ) {
332331 struct comp_dev * sink_dev ;
333- struct comp_buffer * sink ;
334332 int j ;
335333
336- sink = container_of (sink_list , struct comp_buffer , source_list );
337-
338334 /* this has been handled above already */
339335 if (sink == dd -> local_buffer )
340336 continue ;
@@ -1644,17 +1640,16 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun
16441640 sink_frames = free_bytes / audio_stream_frame_bytes (& dd -> dma_buffer -> stream );
16451641 frames = MIN (src_frames , sink_frames );
16461642
1647- struct list_item * sink_list ;
16481643 /*
16491644 * In the case of playback DAI's with multiple sink buffers, compute the
16501645 * minimum number of frames based on the DMA avail_bytes and the free
16511646 * samples in all active sink buffers.
16521647 */
1653- list_for_item (sink_list , & dev -> bsink_list ) {
1648+ struct comp_buffer * sink ;
1649+
1650+ comp_dev_for_each_consumer (dev , sink ) {
16541651 struct comp_dev * sink_dev ;
1655- struct comp_buffer * sink ;
16561652
1657- sink = container_of (sink_list , struct comp_buffer , source_list );
16581653 sink_dev = sink -> sink ;
16591654
16601655 if (sink_dev && sink_dev -> state == COMP_STATE_ACTIVE &&
@@ -1665,8 +1660,6 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun
16651660 }
16661661 }
16671662 } else {
1668- struct list_item * sink_list ;
1669-
16701663 src_frames = avail_bytes / audio_stream_frame_bytes (& dd -> dma_buffer -> stream );
16711664
16721665 /*
@@ -1682,11 +1675,11 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun
16821675 * minimum number of samples based on the DMA avail_bytes and the free
16831676 * samples in all active sink buffers.
16841677 */
1685- list_for_item (sink_list , & dev -> bsink_list ) {
1678+ struct comp_buffer * sink ;
1679+
1680+ comp_dev_for_each_consumer (dev , sink ) {
16861681 struct comp_dev * sink_dev ;
1687- struct comp_buffer * sink ;
16881682
1689- sink = container_of (sink_list , struct comp_buffer , source_list );
16901683 sink_dev = sink -> sink ;
16911684
16921685 if (sink_dev && sink_dev -> state == COMP_STATE_ACTIVE &&
0 commit comments