@@ -269,18 +269,16 @@ dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes,
269269
270270 if (dev -> direction == SOF_IPC_STREAM_PLAYBACK ) {
271271#if CONFIG_IPC_MAJOR_4
272- struct list_item * sink_list ;
273272 /*
274273 * copy from local buffer to all sinks that are not gateway buffers
275274 * using the right PCM converter function.
276275 */
277- list_for_item (sink_list , & dev -> bsink_list ) {
276+ struct comp_buffer * sink ;
277+
278+ comp_dev_for_each_consumer (dev , sink ) {
278279 struct comp_dev * sink_dev ;
279- struct comp_buffer * sink ;
280280 int j ;
281281
282- sink = container_of (sink_list , struct comp_buffer , source_list );
283-
284282 if (sink == dd -> dma_buffer )
285283 continue ;
286284
@@ -319,20 +317,18 @@ dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes,
319317 ret = stream_copy_from_no_consume (dd -> dma_buffer , dd -> local_buffer ,
320318 dd -> process , bytes , dd -> chmap );
321319#if CONFIG_IPC_MAJOR_4
322- struct list_item * sink_list ;
323320 /* Skip in case of endpoint DAI devices created by the copier */
324321 if (converter ) {
325322 /*
326323 * copy from DMA buffer to all sink buffers using the right PCM converter
327324 * function
328325 */
329- list_for_item (sink_list , & dev -> bsink_list ) {
326+ struct comp_buffer * sink ;
327+
328+ comp_dev_for_each_consumer (dev , sink ) {
330329 struct comp_dev * sink_dev ;
331- struct comp_buffer * sink ;
332330 int j ;
333331
334- sink = container_of (sink_list , struct comp_buffer , source_list );
335-
336332 /* this has been handled above already */
337333 if (sink == dd -> local_buffer )
338334 continue ;
@@ -1592,17 +1588,16 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun
15921588 sink_frames = free_bytes / audio_stream_frame_bytes (& dd -> dma_buffer -> stream );
15931589 frames = MIN (src_frames , sink_frames );
15941590
1595- struct list_item * sink_list ;
15961591 /*
15971592 * In the case of playback DAI's with multiple sink buffers, compute the
15981593 * minimum number of frames based on the DMA avail_bytes and the free
15991594 * samples in all active sink buffers.
16001595 */
1601- list_for_item (sink_list , & dev -> bsink_list ) {
1596+ struct comp_buffer * sink ;
1597+
1598+ comp_dev_for_each_consumer (dev , sink ) {
16021599 struct comp_dev * sink_dev ;
1603- struct comp_buffer * sink ;
16041600
1605- sink = container_of (sink_list , struct comp_buffer , source_list );
16061601 sink_dev = sink -> sink ;
16071602
16081603 if (sink_dev && sink_dev -> state == COMP_STATE_ACTIVE &&
@@ -1613,8 +1608,6 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun
16131608 }
16141609 }
16151610 } else {
1616- struct list_item * sink_list ;
1617-
16181611 src_frames = avail_bytes / audio_stream_frame_bytes (& dd -> dma_buffer -> stream );
16191612
16201613 /*
@@ -1630,11 +1623,11 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun
16301623 * minimum number of samples based on the DMA avail_bytes and the free
16311624 * samples in all active sink buffers.
16321625 */
1633- list_for_item (sink_list , & dev -> bsink_list ) {
1626+ struct comp_buffer * sink ;
1627+
1628+ comp_dev_for_each_consumer (dev , sink ) {
16341629 struct comp_dev * sink_dev ;
1635- struct comp_buffer * sink ;
16361630
1637- sink = container_of (sink_list , struct comp_buffer , source_list );
16381631 sink_dev = sink -> sink ;
16391632
16401633 if (sink_dev && sink_dev -> state == COMP_STATE_ACTIVE &&
0 commit comments