@@ -531,9 +531,9 @@ int src_params_general(struct processing_module *mod,
531531 }
532532
533533 /* free any existing delay lines. TODO reuse if same size */
534- rfree ( cd -> delay_lines );
534+ mod_free ( mod , cd -> delay_lines );
535535
536- cd -> delay_lines = rballoc ( SOF_MEM_FLAG_USER , delay_lines_size );
536+ cd -> delay_lines = mod_alloc ( mod , delay_lines_size , 0 );
537537 if (!cd -> delay_lines ) {
538538 comp_err (dev , "src_params(): failed to alloc cd->delay_lines, delay_lines_size = %zu" ,
539539 delay_lines_size );
@@ -594,7 +594,7 @@ int src_param_set(struct comp_dev *dev, struct comp_data *cd)
594594 return 0 ;
595595}
596596
597- int src_allocate_copy_stages (struct comp_dev * dev , struct src_param * prm ,
597+ int src_allocate_copy_stages (struct processing_module * mod , struct src_param * prm ,
598598 const struct src_stage * stage_src1 ,
599599 const struct src_stage * stage_src2 )
600600{
@@ -607,10 +607,9 @@ int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
607607 size_t tap_size = sizeof (int32_t );
608608#endif
609609
610- stage_dst = rmalloc (SOF_MEM_FLAG_USER ,
611- 2 * sizeof (* stage_dst ));
610+ stage_dst = mod_alloc (mod , 2 * sizeof (* stage_dst ), 0 );
612611 if (!stage_dst ) {
613- comp_err (dev , "failed to allocate stages" );
612+ comp_err (mod -> dev , "failed to allocate stages" );
614613 return - ENOMEM ;
615614 }
616615
@@ -622,20 +621,20 @@ int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
622621 coef_size [1 ] = tap_size * stage_src2 -> filter_length ;
623622
624623 if (coef_size [0 ] == 0 || coef_size [1 ] == 0 ) {
625- comp_err (dev ,
624+ comp_err (mod -> dev ,
626625 "illegal zero coefficient vector size for unsupported conversion request %d to %d" ,
627626 prm -> in_fs [prm -> idx_in ], prm -> out_fs [prm -> idx_out ]);
628- rfree ( stage_dst );
627+ mod_free ( mod , stage_dst );
629628 return - EINVAL ;
630629 }
631630
632631 stage_dst [0 ].coefs = fast_get (stage_src1 -> coefs , coef_size [0 ]);
633632 stage_dst [1 ].coefs = fast_get (stage_src2 -> coefs , coef_size [1 ]);
634633
635634 if (!stage_dst [0 ].coefs || !stage_dst [1 ].coefs ) {
636- comp_err (dev , "failed to allocate coefficients" );
635+ comp_err (mod -> dev , "failed to allocate coefficients" );
637636 fast_put (stage_dst [0 ].coefs );
638- rfree ( stage_dst );
637+ mod_free ( mod , stage_dst );
639638 return - ENOMEM ;
640639 }
641640
@@ -714,14 +713,14 @@ __cold int src_free(struct processing_module *mod)
714713 comp_info (mod -> dev , "src_free()" );
715714
716715 /* Free dynamically reserved buffers for SRC algorithm */
717- rfree ( cd -> delay_lines );
716+ mod_free ( mod , cd -> delay_lines );
718717#if CONFIG_FAST_GET
719718 if (cd -> param .stage1 ) {
720719 fast_put (cd -> param .stage1 -> coefs );
721720 fast_put (cd -> param .stage2 -> coefs );
722721 }
723- rfree ( (void * )cd -> param .stage1 );
722+ mod_free ( mod , (void * )cd -> param .stage1 );
724723#endif
725- rfree ( cd );
724+ mod_free ( mod , cd );
726725 return 0 ;
727726}
0 commit comments