diff --git a/src/audio/copier.c b/src/audio/copier.c index 53dd5a2d897a..a30334762515 100644 --- a/src/audio/copier.c +++ b/src/audio/copier.c @@ -409,7 +409,7 @@ static int copier_comp_trigger(struct comp_dev *dev, int cmd) if (cd->endpoint) ret = cd->endpoint->drv->ops.trigger(cd->endpoint, cmd); - return 0; + return ret; } /* copy and process stream data from source to sink buffers */ diff --git a/src/audio/pipeline/pipeline-schedule.c b/src/audio/pipeline/pipeline-schedule.c index 2ba83cab70bb..664a050c3d4f 100644 --- a/src/audio/pipeline/pipeline-schedule.c +++ b/src/audio/pipeline/pipeline-schedule.c @@ -157,6 +157,7 @@ void pipeline_schedule_triggered(struct pipeline_walk_context *ctx, struct list_item *tlist; struct pipeline *p; uint32_t flags; + bool first_pipe = false; /* * Interrupts have to be disabled while adding tasks to or removing them @@ -180,10 +181,10 @@ void pipeline_schedule_triggered(struct pipeline_walk_context *ctx, p = container_of(tlist, struct pipeline, list); if (pipeline_is_timer_driven(p)) { /* Use the first of connected pipelines to trigger */ - if (cmd >= 0) { + if (cmd >= 0 && !first_pipe) { p->trigger.cmd = cmd; p->trigger.host = ppl_data->start; - cmd = -EINVAL; + first_pipe = true; } } else { p->xrun_bytes = 0; diff --git a/src/audio/smart_amp/smart_amp.c b/src/audio/smart_amp/smart_amp.c index 555cee24f02f..9749fcd41fe7 100644 --- a/src/audio/smart_amp/smart_amp.c +++ b/src/audio/smart_amp/smart_amp.c @@ -240,10 +240,6 @@ static struct comp_dev *smart_amp_new(const struct comp_driver *drv, if (bs > 0 && bs < sizeof(struct sof_smart_amp_config)) { comp_err(dev, "smart_amp_new(): failed to apply config"); - - if (sad) - rfree(sad); - rfree(sad); goto error; } @@ -282,6 +278,8 @@ static struct comp_dev *smart_amp_new(const struct comp_driver *drv, return dev; error: + rfree(sad); + rfree(dev); return NULL; } diff --git a/src/drivers/mediatek/mt8195/afe-drv.c b/src/drivers/mediatek/mt8195/afe-drv.c index 3ae30e718c1b..f9461f55a449 100644 --- a/src/drivers/mediatek/mt8195/afe-drv.c +++ b/src/drivers/mediatek/mt8195/afe-drv.c @@ -232,7 +232,7 @@ unsigned int afe_memif_get_cur_position(struct mtk_base_afe *afe, int id) int afe_dai_set_config(struct mtk_base_afe *afe, int id, unsigned int channel, unsigned int rate, unsigned int format) { - struct mtk_base_afe_dai *dai = &afe->dais[id]; + struct mtk_base_afe_dai *dai; /* TODO 1. if need use dai->id to search target dai */ /* TODO 1. if need a status to control the dai status */ @@ -256,7 +256,7 @@ int afe_dai_set_config(struct mtk_base_afe *afe, int id, unsigned int channel, u int afe_dai_get_config(struct mtk_base_afe *afe, int id, unsigned int *channel, unsigned int *rate, unsigned int *format) { - struct mtk_base_afe_dai *dai = &afe->dais[id]; + struct mtk_base_afe_dai *dai; /* TODO 1. if need use dai->id to search target dai */ /* TODO 1. if need a status to control the dai status */ diff --git a/src/ipc/ipc3/dai.c b/src/ipc/ipc3/dai.c index 7d1628f742ce..3f920e924e00 100644 --- a/src/ipc/ipc3/dai.c +++ b/src/ipc/ipc3/dai.c @@ -90,9 +90,9 @@ int ipc_dai_data_config(struct comp_dev *dev) { struct dai_data *dd = comp_get_drvdata(dev); struct ipc_config_dai *dai = &dd->ipc_config; - struct sof_ipc_dai_config *dai_config = ipc_from_dai_config(dd->dai_spec_config); + struct sof_ipc_dai_config *config = ipc_from_dai_config(dd->dai_spec_config); - if (!dai_config) { + if (!config) { comp_err(dev, "dai_data_config(): no config set for dai %d type %d", dai->dai_index, dai->type); return -EINVAL; @@ -115,18 +115,18 @@ int ipc_dai_data_config(struct comp_dev *dev) return -EINVAL; } - switch (dai_config->type) { + switch (config->type) { case SOF_DAI_INTEL_SSP: /* set dma burst elems to slot number */ - dd->config.burst_elems = dai_config->ssp.tdm_slots; + dd->config.burst_elems = config->ssp.tdm_slots; break; case SOF_DAI_INTEL_DMIC: /* We can use always the largest burst length. */ dd->config.burst_elems = 8; comp_info(dev, "config->dmic.fifo_bits = %u config->dmic.num_pdm_active = %u", - dai_config->dmic.fifo_bits, - dai_config->dmic.num_pdm_active); + config->dmic.fifo_bits, + config->dmic.num_pdm_active); break; case SOF_DAI_INTEL_HDA: break; @@ -143,7 +143,7 @@ int ipc_dai_data_config(struct comp_dev *dev) /* As with HDA, the DMA channel is assigned in runtime, * not during topology parsing. */ - dd->stream_id = dai_config->alh.stream_id; + dd->stream_id = config->alh.stream_id; break; case SOF_DAI_IMX_SAI: COMPILER_FALLTHROUGH; @@ -166,7 +166,7 @@ int ipc_dai_data_config(struct comp_dev *dev) default: /* other types of DAIs not handled for now */ comp_warn(dev, "dai_data_config(): Unknown dai type %d", - dai_config->type); + config->type); break; } diff --git a/src/ipc/ipc4/dai.c b/src/ipc/ipc4/dai.c index 3d112c31dc75..36afb098efd7 100644 --- a/src/ipc/ipc4/dai.c +++ b/src/ipc/ipc4/dai.c @@ -69,8 +69,7 @@ int ipc_dai_data_config(struct comp_dev *dev) struct alh_pdata *alh; if (!dai) { - comp_err(dev, "dai_data_config(): no config set for dai %d type %d", - dai->dai_index, dai->type); + comp_err(dev, "dai_data_config(): no dai!\n"); return -EINVAL; } @@ -139,7 +138,7 @@ int dai_config(struct comp_dev *dev, struct ipc_config_dai *common_config, struct ipc4_copier_module_cfg *copier_cfg = spec_config; struct dai_data *dd = comp_get_drvdata(dev); int size; - int ret = 0; + int ret; /* ignore if message not for this DAI id/type */ if (dd->ipc_config.dai_index != common_config->dai_index || @@ -185,6 +184,7 @@ int dai_config(struct comp_dev *dev, struct ipc_config_dai *common_config, if (ret < 0) { rfree(dd->dai_spec_config); dd->dai_spec_config = NULL; + return -EINVAL; } } diff --git a/src/platform/amd/renoir/lib/clk.c b/src/platform/amd/renoir/lib/clk.c index d05c870b3ace..75e203084011 100644 --- a/src/platform/amd/renoir/lib/clk.c +++ b/src/platform/amd/renoir/lib/clk.c @@ -81,7 +81,8 @@ static void acp_reg_write_via_smn(uint32_t reg_offset, ACP_SRBM_CYCLE_STS); if (!acp_srbm_cycle_sts.bits.srbm_clients_sts) return; - } delay_cnt--; + delay_cnt--; + } } static void get_response_from_smu(void) diff --git a/src/platform/amd/renoir/platform.c b/src/platform/amd/renoir/platform.c index 491401c1045f..cc5d0a567755 100644 --- a/src/platform/amd/renoir/platform.c +++ b/src/platform/amd/renoir/platform.c @@ -87,13 +87,15 @@ int platform_init(struct sof *sof) clock_set_freq(CLK_CPU(cpu_get_id()), CLK_MAX_CPU_HZ); /* init DMA */ ret = acp_dma_init(sof); + if (ret < 0) + return -ENODEV; /* Init DMA platform domain */ sof->platform_dma_domain = dma_multi_chan_domain_init(&sof->dma_info->dma_array[0], sizeof(sof->dma_info->dma_array), PLATFORM_DEFAULT_CLOCK, true); scheduler_init_ll(sof->platform_dma_domain); - /* initialize the host IPC mechanims */ + /* initialize the host IPC mechanisms */ ipc_init(sof); - /* initialize the DAI mechanims */ + /* initialize the DAI mechanisms */ ret = dai_init(sof); if (ret < 0) return -ENODEV;