From d3afb00220becf81bc2d9016f04e05949dfd5bb2 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 14 Jan 2021 14:33:35 +0100 Subject: [PATCH 1/3] ASoC: intel: skl: Simplify with dma_set_mask_and_coherent() ASoC Intel Skylake driver still has explicit calls of dma_set_mask() and dma_set_coherent_mask(). Let's simplify with dma_set_mask_and_coherent(). Cc: Cezary Rojewski Cc: Pierre-Louis Bossart Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20210114133337.1039-2-tiwai@suse.de Signed-off-by: Mark Brown --- sound/soc/intel/skylake/skl.c | 8 ++------ 1 file changed, 2 insertions(+), 6 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 From ab152afa2427bb3e4eea7c9f21c4393287838774 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 14 Jan 2021 14:33:36 +0100 Subject: [PATCH 2/3] ASoC: SOF: intel: Simplify with dma_set_mask_and_coherent() ASoC Intel SOF driver still has explicit calls of dma_set_mask() and dma_set_coherent_mask(). Let's simplify with dma_set_mask_and_coherent(). Cc: Pierre-Louis Bossart Cc: Ranjani Sridharan Cc: Kai Vehmanen Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20210114133337.1039-3-tiwai@suse.de Signed-off-by: Mark Brown --- sound/soc/sof/intel/hda.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 */ From 7cc206bff69b52be24fa13ee2c9afde3320c6cf6 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 14 Jan 2021 14:33:37 +0100 Subject: [PATCH 3/3] ASoC: tegra: Simplify with dma_set_mask_and_coherent() ASoC tegra PCM code still has explicit calls of dma_set_mask() and dma_set_coherent_mask(). Let's simplify with dma_set_mask_and_coherent(). Cc: Thierry Reding Cc: Jonathan Hunter Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20210114133337.1039-4-tiwai@suse.de Signed-off-by: Mark Brown --- sound/soc/tegra/tegra_pcm.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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;