@@ -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,10 +594,11 @@ 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{
601+ struct comp_dev * dev = mod -> dev ;
601602#if CONFIG_FAST_GET
602603 struct src_stage * stage_dst ;
603604 size_t coef_size [2 ];
@@ -607,8 +608,7 @@ int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
607608 size_t tap_size = sizeof (int32_t );
608609#endif
609610
610- stage_dst = rmalloc (SOF_MEM_FLAG_USER ,
611- 2 * sizeof (* stage_dst ));
611+ stage_dst = mod_alloc (mod , 2 * sizeof (* stage_dst ), 0 );
612612 if (!stage_dst ) {
613613 comp_err (dev , "failed to allocate stages" );
614614 return - ENOMEM ;
@@ -625,7 +625,7 @@ int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
625625 comp_err (dev ,
626626 "illegal zero coefficient vector size for unsupported conversion request %d to %d" ,
627627 prm -> in_fs [prm -> idx_in ], prm -> out_fs [prm -> idx_out ]);
628- rfree ( stage_dst );
628+ mod_free ( mod , stage_dst );
629629 return - EINVAL ;
630630 }
631631
@@ -635,7 +635,7 @@ int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
635635 if (!stage_dst [0 ].coefs || !stage_dst [1 ].coefs ) {
636636 comp_err (dev , "failed to allocate coefficients" );
637637 fast_put (stage_dst [0 ].coefs );
638- rfree ( stage_dst );
638+ mod_free ( mod , stage_dst );
639639 return - ENOMEM ;
640640 }
641641
@@ -714,14 +714,14 @@ __cold int src_free(struct processing_module *mod)
714714 comp_info (mod -> dev , "src_free()" );
715715
716716 /* Free dynamically reserved buffers for SRC algorithm */
717- rfree ( cd -> delay_lines );
717+ mod_free ( mod , cd -> delay_lines );
718718#if CONFIG_FAST_GET
719719 if (cd -> param .stage1 ) {
720720 fast_put (cd -> param .stage1 -> coefs );
721721 fast_put (cd -> param .stage2 -> coefs );
722722 }
723- rfree ( (void * )cd -> param .stage1 );
723+ mod_free ( mod , (void * )cd -> param .stage1 );
724724#endif
725- rfree ( cd );
725+ mod_free ( mod , cd );
726726 return 0 ;
727727}
0 commit comments