Skip to content

Commit d6afaa1

Browse files
Codrin Ciubotariucristibirsan
authored andcommitted
Revert "ASoC: dmaengine: do not use a NULL prepare_slave_config() callback"
This reverts commit 9a1e134. 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 <sha@pengutronix.de> Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
1 parent e678a68 commit d6afaa1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

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

8383
memset(&slave_config, 0, sizeof(slave_config));
8484

85-
if (pcm->config && pcm->config->prepare_slave_config)
86-
prepare_slave_config = pcm->config->prepare_slave_config;
87-
else
85+
if (!pcm->config)
8886
prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config;
87+
else
88+
prepare_slave_config = pcm->config->prepare_slave_config;
8989

9090
if (prepare_slave_config) {
9191
int ret = prepare_slave_config(substream, params, &slave_config);

0 commit comments

Comments
 (0)