Skip to content

Commit 660564f

Browse files
codrin989broonie
authored andcommitted
ASoC: dmaengine: Restore NULL prepare_slave_config() callback
As pointed out by Sascha Hauer, this patch changes: if (pmc->config && !pcm->config->prepare_slave_config) <do nothing> to: if (pmc->config && !pcm->config->prepare_slave_config) snd_dmaengine_pcm_prepare_slave_config() This breaks the drivers that do not need a call to dmaengine_slave_config(). Drivers that still need to call snd_dmaengine_pcm_prepare_slave_config(), but have a NULL pcm->config->prepare_slave_config should use snd_dmaengine_pcm_prepare_slave_config() as their prepare_slave_config callback. Fixes: 9a1e134 ("ASoC: dmaengine: do not use a NULL prepare_slave_config() callback") Reported-by: Sascha Hauer <[email protected]> Signed-off-by: Codrin Ciubotariu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2bde198 commit 660564f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound/soc/soc-generic-dmaengine-pcm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ static int dmaengine_pcm_hw_params(struct snd_soc_component *component,
8686

8787
memset(&slave_config, 0, sizeof(slave_config));
8888

89-
if (pcm->config && pcm->config->prepare_slave_config)
90-
prepare_slave_config = pcm->config->prepare_slave_config;
91-
else
89+
if (!pcm->config)
9290
prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config;
91+
else
92+
prepare_slave_config = pcm->config->prepare_slave_config;
9393

9494
if (prepare_slave_config) {
9595
int ret = prepare_slave_config(substream, params, &slave_config);

0 commit comments

Comments
 (0)