Skip to content

Commit 53cd9f3

Browse files
committed
Audio: TDFB: Same init() cleanup
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 05e2ce1 commit 53cd9f3

1 file changed

Lines changed: 3 additions & 18 deletions

File tree

src/audio/tdfb/tdfb.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -537,21 +537,12 @@ static int tdfb_init(struct processing_module *mod)
537537
{
538538
struct module_data *md = &mod->priv;
539539
struct comp_dev *dev = mod->dev;
540-
struct module_config *cfg = &md->cfg;
541540
struct tdfb_comp_data *cd;
542-
size_t bs = cfg->size;
543541
int ret;
544542
int i;
545543

546544
comp_info(dev, "entry");
547545

548-
/* Check first that configuration blob size is sane */
549-
if (bs > SOF_TDFB_MAX_SIZE) {
550-
comp_err(dev, "error: configuration blob size = %zu > %d",
551-
bs, SOF_TDFB_MAX_SIZE);
552-
return -EINVAL;
553-
}
554-
555546
cd = mod_zalloc(mod, sizeof(*cd));
556547
if (!cd)
557548
return -ENOMEM;
@@ -579,13 +570,6 @@ static int tdfb_init(struct processing_module *mod)
579570
goto err;
580571
}
581572

582-
/* Get configuration data and reset FIR filters */
583-
ret = comp_init_data_blob(cd->model_handler, bs, cfg->data);
584-
if (ret < 0) {
585-
comp_err(dev, "comp_init_data_blob() failed.");
586-
goto err;
587-
}
588-
589573
for (i = 0; i < PLATFORM_MAX_CHANNELS; i++)
590574
fir_reset(&cd->fir[i]);
591575

@@ -723,6 +707,7 @@ static int tdfb_prepare(struct processing_module *mod,
723707
struct comp_buffer *sourceb, *sinkb;
724708
struct comp_dev *dev = mod->dev;
725709
enum sof_ipc_frame frame_fmt;
710+
size_t data_size;
726711
int source_channels;
727712
int sink_channels;
728713
int rate;
@@ -752,8 +737,8 @@ static int tdfb_prepare(struct processing_module *mod,
752737
rate = audio_stream_get_rate(&sourceb->stream);
753738

754739
/* Initialize filter */
755-
cd->config = comp_get_data_blob(cd->model_handler, NULL, NULL);
756-
if (!cd->config) {
740+
cd->config = comp_get_data_blob(cd->model_handler, &data_size, NULL);
741+
if (!cd->config && data_size > 0) {
757742
ret = -EINVAL;
758743
goto out;
759744
}

0 commit comments

Comments
 (0)