mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-03 09:06:57 +07:00
ASoC: dmaengine: Remove unnecessary snd_pcm_lib_preallocate_free_for_all()
The ALSA core takes care that all preallocated memory is freed when the PCM itself is freed. There is no need to do this manually in the driver. Similarly there is also no need to do it on the pcm_new() error path as the PCM will be freed if a error is returned. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
97bf6af1f9
commit
de7621e870
@ -200,11 +200,6 @@ static int dmaengine_pcm_open(struct snd_pcm_substream *substream)
|
||||
return snd_dmaengine_pcm_open(substream, chan);
|
||||
}
|
||||
|
||||
static void dmaengine_pcm_free(struct snd_pcm *pcm)
|
||||
{
|
||||
snd_pcm_lib_preallocate_free_for_all(pcm);
|
||||
}
|
||||
|
||||
static struct dma_chan *dmaengine_pcm_compat_request_channel(
|
||||
struct snd_soc_pcm_runtime *rtd,
|
||||
struct snd_pcm_substream *substream)
|
||||
@ -283,8 +278,7 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
||||
if (!pcm->chan[i]) {
|
||||
dev_err(rtd->platform->dev,
|
||||
"Missing dma channel for stream: %d\n", i);
|
||||
ret = -EINVAL;
|
||||
goto err_free;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = snd_pcm_lib_preallocate_pages(substream,
|
||||
@ -293,7 +287,7 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
||||
prealloc_buffer_size,
|
||||
max_buffer_size);
|
||||
if (ret)
|
||||
goto err_free;
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* This will only return false if we know for sure that at least
|
||||
@ -307,10 +301,6 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_free:
|
||||
dmaengine_pcm_free(rtd->pcm);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static snd_pcm_uframes_t dmaengine_pcm_pointer(
|
||||
@ -341,7 +331,6 @@ static const struct snd_soc_platform_driver dmaengine_pcm_platform = {
|
||||
},
|
||||
.ops = &dmaengine_pcm_ops,
|
||||
.pcm_new = dmaengine_pcm_new,
|
||||
.pcm_free = dmaengine_pcm_free,
|
||||
};
|
||||
|
||||
static const char * const dmaengine_pcm_dma_channel_names[] = {
|
||||
|
Loading…
Reference in New Issue
Block a user