29 Jan
2020
29 Jan
'20
8:48 a.m.
One comment below:
+int sof_probe_compr_set_params(struct snd_compr_stream *cstream,
struct snd_compr_params *params, struct snd_soc_dai
*dai) +{
- struct snd_compr_runtime *rtd = cstream->runtime;
- struct snd_sof_dev *sdev =
snd_soc_component_get_drvdata(dai-
component);
- int ret;
- cstream->dma_buffer.dev.type = SNDRV_DMA_TYPE_DEV_SG;
- cstream->dma_buffer.dev.dev = sdev->dev;
- ret = snd_compr_malloc_pages(cstream, rtd->buffer_size);
- if (ret < 0)
return ret;
- ret = snd_sof_probe_compr_set_params(sdev, cstream, params,
dai);
- if (ret < 0)
return ret;
- ret = sof_ipc_probe_init(sdev, sdev->extractor_stream_tag,
rtd->dma_bytes);
- if (ret < 0) {
dev_err(dai->dev, "Failed to init probe: %d\n", ret);
return ret;
- }
Should we call snd_compr_free_pages on error case?