summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/intel
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2019-12-25 17:51:43 +0000
committerMark Brown <broonie@kernel.org>2019-12-25 17:51:43 +0000
commita82cf72f94af1135f2edde0a244499af390f333a (patch)
treeef49c313ce4450e836c4166035d8c276dd977e36 /sound/soc/sof/intel
parentbb9ee1eacb2dfcdf419f14c739b866c3eba4dc1f (diff)
parentdcf08d0f8f09081b16f69071dd55d51d5e964e84 (diff)
downloadtalos-op-linux-a82cf72f94af1135f2edde0a244499af390f333a.tar.gz
talos-op-linux-a82cf72f94af1135f2edde0a244499af390f333a.zip
Merge branch 'for-5.5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.6
Diffstat (limited to 'sound/soc/sof/intel')
-rw-r--r--sound/soc/sof/intel/hda-dai.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c
index 638812a41328..313611dcb5e4 100644
--- a/sound/soc/sof/intel/hda-dai.c
+++ b/sound/soc/sof/intel/hda-dai.c
@@ -217,6 +217,8 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream,
link_dev = hda_link_stream_assign(bus, substream);
if (!link_dev)
return -EBUSY;
+
+ snd_soc_dai_set_dma_data(dai, substream, (void *)link_dev);
}
stream_tag = hdac_stream(link_dev)->stream_tag;
@@ -229,8 +231,6 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream,
if (ret < 0)
return ret;
- snd_soc_dai_set_dma_data(dai, substream, (void *)link_dev);
-
link = snd_hdac_ext_bus_get_link(bus, codec_dai->component->name);
if (!link)
return -EINVAL;
@@ -362,6 +362,13 @@ static int hda_link_hw_free(struct snd_pcm_substream *substream,
bus = hstream->bus;
rtd = snd_pcm_substream_chip(substream);
link_dev = snd_soc_dai_get_dma_data(dai, substream);
+
+ if (!link_dev) {
+ dev_dbg(dai->dev,
+ "%s: link_dev is not assigned\n", __func__);
+ return -EINVAL;
+ }
+
hda_stream = hstream_to_sof_hda_stream(link_dev);
/* free the link DMA channel in the FW */
OpenPOWER on IntegriCloud