summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2021-01-19 16:20:12 +0000
committerMark Brown <broonie@kernel.org>2021-01-19 16:20:12 +0000
commit97692432406d40c71933ee9f07c4dbe327af846b (patch)
treeced6a861b5c4c203fe3be81a0f8e7a32f65d73d3 /sound
parent0dedbde5062dbc3cf71ab1ba40792c04a68008e9 (diff)
parent7cc206bff69b52be24fa13ee2c9afde3320c6cf6 (diff)
downloadlinux-stable-97692432406d40c71933ee9f07c4dbe327af846b.tar.gz
linux-stable-97692432406d40c71933ee9f07c4dbe327af846b.tar.bz2
linux-stable-97692432406d40c71933ee9f07c4dbe327af846b.zip
Merge series "ASoC: Simplify with dma_set_mask_and_coherent()" from Takashi Iwai <tiwai@suse.de>:
Simple conversions from two dma_set_mask*() calls into the single dma_set_mask_and_coherent(). Just a minor code refactoring, no functional changes. Takashi === Takashi Iwai (3): ASoC: intel: skl: Simplify with dma_set_mask_and_coherent() ASoC: SOF: intel: Simplify with dma_set_mask_and_coherent() ASoC: tegra: Simplify with dma_set_mask_and_coherent() sound/soc/intel/skylake/skl.c | 8 ++------ sound/soc/sof/intel/hda.c | 8 ++------ sound/soc/tegra/tegra_pcm.c | 6 +----- 3 files changed, 5 insertions(+), 17 deletions(-) -- 2.26.2
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/intel/skylake/skl.c8
-rw-r--r--sound/soc/sof/intel/hda.c8
-rw-r--r--sound/soc/tegra/tegra_pcm.c6
3 files changed, 5 insertions, 17 deletions
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index 8b993722f74e..5b1a15e39912 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -950,12 +950,8 @@ static int skl_first_init(struct hdac_bus *bus)
bus->num_streams = cp_streams + pb_streams;
/* allow 64bit DMA address if supported by H/W */
- if (!dma_set_mask(bus->dev, DMA_BIT_MASK(64))) {
- dma_set_coherent_mask(bus->dev, DMA_BIT_MASK(64));
- } else {
- dma_set_mask(bus->dev, DMA_BIT_MASK(32));
- dma_set_coherent_mask(bus->dev, DMA_BIT_MASK(32));
- }
+ if (dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(64)))
+ dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(32));
/* initialize streams */
snd_hdac_ext_stream_init_all
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 509a9b256423..7e703ce22fcd 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -809,13 +809,9 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
sdev->mailbox_bar = HDA_DSP_BAR;
/* allow 64bit DMA address if supported by H/W */
- if (!dma_set_mask(&pci->dev, DMA_BIT_MASK(64))) {
- dev_dbg(sdev->dev, "DMA mask is 64 bit\n");
- dma_set_coherent_mask(&pci->dev, DMA_BIT_MASK(64));
- } else {
+ if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(64))) {
dev_dbg(sdev->dev, "DMA mask is 32 bit\n");
- dma_set_mask(&pci->dev, DMA_BIT_MASK(32));
- dma_set_coherent_mask(&pci->dev, DMA_BIT_MASK(32));
+ dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32));
}
/* init streams */
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index b3f36515cbc1..573374b89b10 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -255,11 +255,7 @@ static int tegra_pcm_dma_allocate(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm *pcm = rtd->pcm;
int ret;
- ret = dma_set_mask(card->dev, DMA_BIT_MASK(32));
- if (ret < 0)
- return ret;
-
- ret = dma_set_coherent_mask(card->dev, DMA_BIT_MASK(32));
+ ret = dma_set_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
if (ret < 0)
return ret;