All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/7] ASoC et alia: Convert to use dma_request_chan()
@ 2026-09-15 10:04 Andy Shevchenko
  2026-09-15 10:04 ` [PATCH v1 1/7] ASoC: stm32: spdifrx: Drop mention of the deprecated and unused call Andy Shevchenko
                   ` (6 more replies)
  0 siblings, 7 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-09-15 10:04 UTC (permalink / raw)
  To: Frank Li, Andy Shevchenko, Mark Brown, Shengjiu Wang,
	bui duc phuc, Tianchu Chen, linux-kernel, dmaengine, linux-sound,
	linuxppc-dev, linux-arm-kernel, linux-stm32
  Cc: Dave Penkler, Greg Kroah-Hartman, Vinod Koul, Frank Li,
	Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue

Convert the last users (mostly in ASoC) to use dma_request_chan() and
drop deprecated dma_request_slave_channel() completely.

I think the best is to allow Mark to take the whole lot and provide an
immutable tag or branch to others (DMAengine and GPIB).

Andy Shevchenko (7):
  ASoC: stm32: spdifrx: Drop mention of the deprecated and unused call
  ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan()
  ASoC: soc-generic-dmaengine-pcm: Replace dma_request_slave_channel()
    by dma_request_chan()
  ASoC: pxa: Replace dma_request_slave_channel() by dma_request_chan()
  ASoC: fsl_asrc: Replace dma_request_slave_channel() by
    dma_request_chan()
  gpib: fmh_gpib: Replace dma_request_slave_channel() by
    dma_request_chan()
  dmaengine: Remove deprecated dma_request_slave_channel()

 drivers/gpib/fmh_gpib/fmh_gpib.c      |  7 ++++---
 include/linux/dmaengine.h             |  9 ---------
 sound/soc/fsl/fsl_asrc.c              |  2 +-
 sound/soc/fsl/fsl_asrc_dma.c          | 13 +++++++------
 sound/soc/fsl/fsl_asrc_m2m.c          |  8 ++++----
 sound/soc/fsl/fsl_easrc.c             |  2 +-
 sound/soc/pxa/pxa2xx-pcm-lib.c        | 10 +++++++---
 sound/soc/soc-generic-dmaengine-pcm.c |  8 +++++---
 sound/soc/sprd/sprd-pcm-compress.c    |  7 +++----
 sound/soc/sprd/sprd-pcm-dma.c         |  7 +++----
 sound/soc/stm/stm32_spdifrx.c         |  2 +-
 11 files changed, 36 insertions(+), 39 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v1 1/7] ASoC: stm32: spdifrx: Drop mention of the deprecated and unused call
  2026-09-15 10:04 [PATCH v1 0/7] ASoC et alia: Convert to use dma_request_chan() Andy Shevchenko
@ 2026-09-15 10:04 ` Andy Shevchenko
  2026-09-15 10:04 ` [PATCH v1 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan() Andy Shevchenko
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-09-15 10:04 UTC (permalink / raw)
  To: Frank Li, Andy Shevchenko, Mark Brown, Shengjiu Wang,
	bui duc phuc, Tianchu Chen, linux-kernel, dmaengine, linux-sound,
	linuxppc-dev, linux-arm-kernel, linux-stm32
  Cc: Dave Penkler, Greg Kroah-Hartman, Vinod Koul, Frank Li,
	Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue

The error message was not updated while driver moved from the
deprecated dma_request_slave_channel() to the dma_request_chan().
Update the message by replacing it with the correct function.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/stm/stm32_spdifrx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c
index e0fef47a227e..0ece54740773 100644
--- a/sound/soc/stm/stm32_spdifrx.c
+++ b/sound/soc/stm/stm32_spdifrx.c
@@ -400,7 +400,7 @@ static int stm32_spdifrx_dma_ctrl_register(struct device *dev,
 	spdifrx->ctrl_chan = dma_request_chan(dev, "rx-ctrl");
 	if (IS_ERR(spdifrx->ctrl_chan))
 		return dev_err_probe(dev, PTR_ERR(spdifrx->ctrl_chan),
-				     "dma_request_slave_channel error\n");
+				     "dma_request_chan error\n");
 
 	spdifrx->dmab = devm_kzalloc(dev, sizeof(struct snd_dma_buffer),
 				     GFP_KERNEL);
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v1 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 [PATCH v1 0/7] ASoC et alia: Convert to use dma_request_chan() Andy Shevchenko
  2026-09-15 10:04 ` [PATCH v1 1/7] ASoC: stm32: spdifrx: Drop mention of the deprecated and unused call Andy Shevchenko
@ 2026-09-15 10:04 ` Andy Shevchenko
  2026-09-15 10:19   ` sashiko-bot
                     ` (2 more replies)
  2026-09-15 10:04 ` [PATCH v1 3/7] ASoC: soc-generic-dmaengine-pcm: " Andy Shevchenko
                   ` (4 subsequent siblings)
  6 siblings, 3 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-09-15 10:04 UTC (permalink / raw)
  To: Frank Li, Andy Shevchenko, Mark Brown, Shengjiu Wang,
	bui duc phuc, Tianchu Chen, linux-kernel, dmaengine, linux-sound,
	linuxppc-dev, linux-arm-kernel, linux-stm32
  Cc: Dave Penkler, Greg Kroah-Hartman, Vinod Koul, Frank Li,
	Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue

Replace dma_request_slave_channel() by dma_request_chan() as suggested
since the former is deprecated.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/sprd/sprd-pcm-compress.c | 7 +++----
 sound/soc/sprd/sprd-pcm-dma.c      | 7 +++----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/sound/soc/sprd/sprd-pcm-compress.c b/sound/soc/sprd/sprd-pcm-compress.c
index e5249924b54d..5613c25fffd7 100644
--- a/sound/soc/sprd/sprd-pcm-compress.c
+++ b/sound/soc/sprd/sprd-pcm-compress.c
@@ -153,11 +153,10 @@ static int sprd_platform_compr_dma_config(struct snd_soc_component *component,
 		return -EINVAL;
 	}
 
-	dma->chan = dma_request_slave_channel(dev,
-					      dma_params->chan_name[channel]);
-	if (!dma->chan) {
+	dma->chan = dma_request_chan(dev, dma_params->chan_name[channel]);
+	if (IS_ERR(dma->chan)) {
 		dev_err(dev, "failed to request dma channel\n");
-		return -ENODEV;
+		return PTR_ERR(dma->chan);
 	}
 
 	sgt = sg = kzalloc_objs(*sg, sg_num);
diff --git a/sound/soc/sprd/sprd-pcm-dma.c b/sound/soc/sprd/sprd-pcm-dma.c
index f509a4601de2..1586eff61120 100644
--- a/sound/soc/sprd/sprd-pcm-dma.c
+++ b/sound/soc/sprd/sprd-pcm-dma.c
@@ -171,13 +171,12 @@ static int sprd_pcm_request_dma_channel(struct snd_soc_component *component,
 	for (i = 0; i < channels; i++) {
 		struct sprd_pcm_dma_data *data = &dma_private->data[i];
 
-		data->chan = dma_request_slave_channel(dev,
-						       dma_params->chan_name[i]);
-		if (!data->chan) {
+		data->chan = dma_request_chan(dev, dma_params->chan_name[i]);
+		if (IS_ERR(data->chan)) {
 			dev_err(dev, "failed to request dma channel:%s\n",
 				dma_params->chan_name[i]);
 			sprd_pcm_release_dma_channel(substream);
-			return -ENODEV;
+			return PTR_ERR(data->chan);
 		}
 	}
 
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v1 3/7] ASoC: soc-generic-dmaengine-pcm: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 [PATCH v1 0/7] ASoC et alia: Convert to use dma_request_chan() Andy Shevchenko
  2026-09-15 10:04 ` [PATCH v1 1/7] ASoC: stm32: spdifrx: Drop mention of the deprecated and unused call Andy Shevchenko
  2026-09-15 10:04 ` [PATCH v1 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan() Andy Shevchenko
@ 2026-09-15 10:04 ` Andy Shevchenko
  2026-09-15 10:29   ` Cezary Rojewski
  2026-09-15 10:04 ` [PATCH v1 4/7] ASoC: pxa: " Andy Shevchenko
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 24+ messages in thread
From: Andy Shevchenko @ 2026-09-15 10:04 UTC (permalink / raw)
  To: Frank Li, Andy Shevchenko, Mark Brown, Shengjiu Wang,
	bui duc phuc, Tianchu Chen, linux-kernel, dmaengine, linux-sound,
	linuxppc-dev, linux-arm-kernel, linux-stm32
  Cc: Dave Penkler, Greg Kroah-Hartman, Vinod Koul, Frank Li,
	Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue

Replace dma_request_slave_channel() by dma_request_chan() as suggested
since the former is deprecated.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/soc-generic-dmaengine-pcm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
index 65b7ec52a054..6d1dbee8f6c1 100644
--- a/sound/soc/soc-generic-dmaengine-pcm.c
+++ b/sound/soc/soc-generic-dmaengine-pcm.c
@@ -242,9 +242,11 @@ static int dmaengine_pcm_new(struct snd_soc_component *component,
 		if (!substream)
 			continue;
 
-		if (!pcm->chan[i] && config->chan_names[i])
-			pcm->chan[i] = dma_request_slave_channel(dev,
-				config->chan_names[i]);
+		if (!pcm->chan[i] && config->chan_names[i]) {
+			pcm->chan[i] = dma_request_chan(dev, config->chan_names[i]);
+			if (IS_ERR(pcm->chan[i]))
+				pcm->chan[i] = NULL;
+		}
 
 		if (!pcm->chan[i] && (pcm->flags & SND_DMAENGINE_PCM_FLAG_COMPAT)) {
 			pcm->chan[i] = dmaengine_pcm_compat_request_channel(
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v1 4/7] ASoC: pxa: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 [PATCH v1 0/7] ASoC et alia: Convert to use dma_request_chan() Andy Shevchenko
                   ` (2 preceding siblings ...)
  2026-09-15 10:04 ` [PATCH v1 3/7] ASoC: soc-generic-dmaengine-pcm: " Andy Shevchenko
@ 2026-09-15 10:04 ` Andy Shevchenko
  2026-09-15 10:21   ` sashiko-bot
  2026-09-15 10:04 ` [PATCH v1 5/7] ASoC: fsl_asrc: " Andy Shevchenko
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 24+ messages in thread
From: Andy Shevchenko @ 2026-09-15 10:04 UTC (permalink / raw)
  To: Frank Li, Andy Shevchenko, Mark Brown, Shengjiu Wang,
	bui duc phuc, Tianchu Chen, linux-kernel, dmaengine, linux-sound,
	linuxppc-dev, linux-arm-kernel, linux-stm32
  Cc: Dave Penkler, Greg Kroah-Hartman, Vinod Koul, Frank Li,
	Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue

Replace dma_request_slave_channel() by dma_request_chan() as suggested
since the former is deprecated.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/pxa/pxa2xx-pcm-lib.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/sound/soc/pxa/pxa2xx-pcm-lib.c b/sound/soc/pxa/pxa2xx-pcm-lib.c
index 88a9d3226302..0ccf88aa1138 100644
--- a/sound/soc/pxa/pxa2xx-pcm-lib.c
+++ b/sound/soc/pxa/pxa2xx-pcm-lib.c
@@ -79,6 +79,7 @@ static int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
 	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct snd_dmaengine_dai_dma_data *dma_params;
+	struct dma_chan *chan;
 	int ret;
 
 	runtime->hw = pxa2xx_pcm_hardware;
@@ -107,9 +108,12 @@ static int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
 	if (ret < 0)
 		return ret;
 
-	return snd_dmaengine_pcm_open(
-		substream, dma_request_slave_channel(snd_soc_rtd_to_cpu(rtd, 0)->dev,
-						     dma_params->chan_name));
+	chan = dma_request_chan(snd_soc_rtd_to_cpu(rtd, 0)->dev, dma_params->chan_name);
+	ret = PTR_ERR_OR_ZERO(chan);
+	if (ret)
+		return ret;
+
+	return snd_dmaengine_pcm_open(substream, chan);
 }
 
 static int pxa2xx_pcm_close(struct snd_pcm_substream *substream)
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v1 5/7] ASoC: fsl_asrc: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 [PATCH v1 0/7] ASoC et alia: Convert to use dma_request_chan() Andy Shevchenko
                   ` (3 preceding siblings ...)
  2026-09-15 10:04 ` [PATCH v1 4/7] ASoC: pxa: " Andy Shevchenko
@ 2026-09-15 10:04 ` Andy Shevchenko
  2026-09-15 10:25   ` sashiko-bot
                     ` (2 more replies)
  2026-09-15 10:04 ` [PATCH v1 6/7] gpib: fmh_gpib: " Andy Shevchenko
  2026-09-15 10:04 ` [PATCH v1 7/7] dmaengine: Remove deprecated dma_request_slave_channel() Andy Shevchenko
  6 siblings, 3 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-09-15 10:04 UTC (permalink / raw)
  To: Frank Li, Andy Shevchenko, Mark Brown, Shengjiu Wang,
	bui duc phuc, Tianchu Chen, linux-kernel, dmaengine, linux-sound,
	linuxppc-dev, linux-arm-kernel, linux-stm32
  Cc: Dave Penkler, Greg Kroah-Hartman, Vinod Koul, Frank Li,
	Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue

Replace dma_request_slave_channel() by dma_request_chan() as suggested
since the former is deprecated.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/fsl/fsl_asrc.c     |  2 +-
 sound/soc/fsl/fsl_asrc_dma.c | 13 +++++++------
 sound/soc/fsl/fsl_asrc_m2m.c |  8 ++++----
 sound/soc/fsl/fsl_easrc.c    |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index b24737add001..ae682bf450f6 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -638,7 +638,7 @@ static struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair,
 
 	sprintf(name, "%cx%c", dir == IN ? 'r' : 't', index + 'a');
 
-	return dma_request_slave_channel(&asrc->pdev->dev, name);
+	return dma_request_chan(&asrc->pdev->dev, name);
 }
 
 static int fsl_asrc_dai_startup(struct snd_pcm_substream *substream,
diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
index 2f662bdf14d0..5cd12781c604 100644
--- a/sound/soc/fsl/fsl_asrc_dma.c
+++ b/sound/soc/fsl/fsl_asrc_dma.c
@@ -191,9 +191,10 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component,
 	dma_params_fe->maxburst = dma_params_be->maxburst;
 
 	pair->dma_chan[!dir] = asrc->get_dma_channel(pair, !dir);
-	if (!pair->dma_chan[!dir]) {
+	ret = PTR_ERR_OR_ZERO(pair->dma_chan[!dir]);
+	if (ret) {
 		dev_err(dev, "failed to request DMA channel\n");
-		return -EINVAL;
+		return ret;
 	}
 
 	ret = snd_dmaengine_pcm_prepare_slave_config(substream, params, &config_fe);
@@ -404,9 +405,9 @@ static int fsl_asrc_dma_startup(struct snd_soc_component *component,
 
 	/* Request a dummy dma channel, which will be released later. */
 	tmp_chan = asrc->get_dma_channel(pair, dir);
-	if (!tmp_chan) {
+	ret = PTR_ERR_OR_ZERO(tmp_chan);
+	if (ret) {
 		dev_err(dev, "failed to get dma channel\n");
-		ret = -EINVAL;
 		goto dma_chan_err;
 	}
 
@@ -497,9 +498,9 @@ static int fsl_asrc_dma_pcm_new(struct snd_soc_component *component,
 
 	/* Request a dma channel, which will be released later. */
 	chan = asrc->get_dma_channel(pair, IN);
-	if (!chan) {
+	ret = PTR_ERR_OR_ZERO(chan);
+	if (ret) {
 		dev_err(dev, "failed to get dma channel\n");
-		ret = -EINVAL;
 		goto dma_chan_err;
 	}
 
diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
index 4bc40f328f58..e440cc083ebb 100644
--- a/sound/soc/fsl/fsl_asrc_m2m.c
+++ b/sound/soc/fsl/fsl_asrc_m2m.c
@@ -503,16 +503,16 @@ static int fsl_asrc_m2m_comp_task_create(struct snd_compr_stream *stream,
 
 	/* Request dma channels */
 	pair->dma_chan[IN] = asrc->get_dma_channel(pair, IN);
-	if (!pair->dma_chan[IN]) {
+	ret = PTR_ERR_OR_ZERO(pair->dma_chan[IN]);
+	if (ret) {
 		dev_err(dev, "[ctx%d] failed to get input DMA channel\n", pair->index);
-		ret = -EBUSY;
 		goto err_dma_channel_in;
 	}
 
 	pair->dma_chan[OUT] = asrc->get_dma_channel(pair, OUT);
-	if (!pair->dma_chan[OUT]) {
+	ret = PTR_ERR_OR_ZERO(pair->dma_chan[OUT]);
+	if (ret) {
 		dev_err(dev, "[ctx%d] failed to get output DMA channel\n", pair->index);
-		ret = -EBUSY;
 		goto err_dma_channel_out;
 	}
 
diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c
index aced16d1228a..d30cc3e90215 100644
--- a/sound/soc/fsl/fsl_easrc.c
+++ b/sound/soc/fsl/fsl_easrc.c
@@ -1433,7 +1433,7 @@ static struct dma_chan *fsl_easrc_get_dma_channel(struct fsl_asrc_pair *ctx,
 	/* Example of dma name: ctx0_rx */
 	sprintf(name, "ctx%c_%cx", index + '0', dir == IN ? 'r' : 't');
 
-	return dma_request_slave_channel(&easrc->pdev->dev, name);
+	return dma_request_chan(&easrc->pdev->dev, name);
 };
 
 static const unsigned int easrc_rates[] = {
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v1 6/7] gpib: fmh_gpib: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 [PATCH v1 0/7] ASoC et alia: Convert to use dma_request_chan() Andy Shevchenko
                   ` (4 preceding siblings ...)
  2026-09-15 10:04 ` [PATCH v1 5/7] ASoC: fsl_asrc: " Andy Shevchenko
@ 2026-09-15 10:04 ` Andy Shevchenko
  2026-09-15 10:21   ` sashiko-bot
  2026-09-15 14:16   ` Dave Penkler
  2026-09-15 10:04 ` [PATCH v1 7/7] dmaengine: Remove deprecated dma_request_slave_channel() Andy Shevchenko
  6 siblings, 2 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-09-15 10:04 UTC (permalink / raw)
  To: Frank Li, Andy Shevchenko, Mark Brown, Shengjiu Wang,
	bui duc phuc, Tianchu Chen, linux-kernel, dmaengine, linux-sound,
	linuxppc-dev, linux-arm-kernel, linux-stm32
  Cc: Dave Penkler, Greg Kroah-Hartman, Vinod Koul, Frank Li,
	Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue

Replace dma_request_slave_channel() by dma_request_chan() as suggested
since the former is deprecated.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpib/fmh_gpib/fmh_gpib.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpib/fmh_gpib/fmh_gpib.c b/drivers/gpib/fmh_gpib/fmh_gpib.c
index 5e10e9353fed..3fdcc673ec8b 100644
--- a/drivers/gpib/fmh_gpib/fmh_gpib.c
+++ b/drivers/gpib/fmh_gpib/fmh_gpib.c
@@ -1458,10 +1458,11 @@ static int fmh_gpib_attach_impl(struct gpib_board *board, const struct gpib_boar
 	e_priv->irq = irq;
 
 	if (acquire_dma) {
-		e_priv->dma_channel = dma_request_slave_channel(board->dev, "rxtx");
-		if (!e_priv->dma_channel) {
+		e_priv->dma_channel = dma_request_chan(board->dev, "rxtx");
+		retval = PTR_ERR_OR_ZERO(e_priv->dma_channel);
+		if (retval) {
 			dev_err(board->dev, "failed to acquire dma channel \"rxtx\".\n");
-			return -EIO;
+			return retval;
 		}
 	}
 	/*
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v1 7/7] dmaengine: Remove deprecated dma_request_slave_channel()
  2026-09-15 10:04 [PATCH v1 0/7] ASoC et alia: Convert to use dma_request_chan() Andy Shevchenko
                   ` (5 preceding siblings ...)
  2026-09-15 10:04 ` [PATCH v1 6/7] gpib: fmh_gpib: " Andy Shevchenko
@ 2026-09-15 10:04 ` Andy Shevchenko
  2026-09-15 14:03   ` Frank Li
  2026-09-15 17:37   ` Vinod Koul
  6 siblings, 2 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-09-15 10:04 UTC (permalink / raw)
  To: Frank Li, Andy Shevchenko, Mark Brown, Shengjiu Wang,
	bui duc phuc, Tianchu Chen, linux-kernel, dmaengine, linux-sound,
	linuxppc-dev, linux-arm-kernel, linux-stm32
  Cc: Dave Penkler, Greg Kroah-Hartman, Vinod Koul, Frank Li,
	Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue

No more users.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/dmaengine.h | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index c50497ecd52d..7596ebdac466 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -1763,15 +1763,6 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
 #define dma_request_channel(mask, x, y) \
 	__dma_request_channel(&(mask), x, y, NULL)
 
-/* Deprecated, please use dma_request_chan() directly */
-static inline struct dma_chan * __deprecated
-dma_request_slave_channel(struct device *dev, const char *name)
-{
-	struct dma_chan *ch = dma_request_chan(dev, name);
-
-	return IS_ERR(ch) ? NULL : ch;
-}
-
 static inline struct dma_chan
 *dma_request_slave_channel_compat(const dma_cap_mask_t mask,
 				  dma_filter_fn fn, void *fn_param,
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 ` [PATCH v1 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan() Andy Shevchenko
@ 2026-09-15 10:19   ` sashiko-bot
  2026-09-15 14:04     ` Andy Shevchenko
  2026-09-15 10:54   ` Baolin Wang
  2026-09-15 17:35   ` Mark Brown
  2 siblings, 1 reply; 24+ messages in thread
From: sashiko-bot @ 2026-09-15 10:19 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Frank.Li, vkoul, dmaengine

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] ASoC: sprd: crash in dma_release_channel() due to ERR_PTR leak
--

commit 5e4c398ebe4c03b68c30e555198977e4ad4905e4
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan()

This commit replaces deprecated dma_request_slave_channel calls with
dma_request_chan. It updates the error checking from NULL checks to
IS_ERR.

> diff --git a/sound/soc/sprd/sprd-pcm-compress.c b/sound/soc/sprd/sprd-pcm-compress.c
> index e5249924b54d9..5613c25fffd73 100644
> --- a/sound/soc/sprd/sprd-pcm-compress.c
> +++ b/sound/soc/sprd/sprd-pcm-compress.c
> @@ -153,11 +153,10 @@ static int sprd_platform_compr_dma_config(struct snd_soc_component *component,
>  		return -EINVAL;
>  	}
>  
> -	dma->chan = dma_request_slave_channel(dev,
> -					      dma_params->chan_name[channel]);
> -	if (!dma->chan) {
> +	dma->chan = dma_request_chan(dev, dma_params->chan_name[channel]);
> +	if (IS_ERR(dma->chan)) {

[Severity: High]
If dma_request_chan fails, does this leak the error pointer into the compress
stream's persistent dma array?

When the file descriptor is closed or cleaned up, the free path in
sprd_platform_compr_free() will attempt to release the channel:

    if (dma->chan) {
        dma_release_channel(dma->chan);
        dma->chan = NULL;
    }

Since the error path doesn't clear the error pointer from dma->chan, the if
check evaluates to true. Will dma_release_channel() then dereference the error
pointer and crash?

>  		dev_err(dev, "failed to request dma channel\n");
> -		return -ENODEV;
> +		return PTR_ERR(dma->chan);
>  	}
>  
>  	sgt = sg = kzalloc_objs(*sg, sg_num);
> diff --git a/sound/soc/sprd/sprd-pcm-dma.c b/sound/soc/sprd/sprd-pcm-dma.c
> index f509a4601de25..1586eff61120a 100644
> --- a/sound/soc/sprd/sprd-pcm-dma.c
> +++ b/sound/soc/sprd/sprd-pcm-dma.c
> @@ -171,13 +171,12 @@ static int sprd_pcm_request_dma_channel(struct snd_soc_component *component,
>  	for (i = 0; i < channels; i++) {
>  		struct sprd_pcm_dma_data *data = &dma_private->data[i];
>  
> -		data->chan = dma_request_slave_channel(dev,
> -						       dma_params->chan_name[i]);
> -		if (!data->chan) {
> +		data->chan = dma_request_chan(dev, dma_params->chan_name[i]);
> +		if (IS_ERR(data->chan)) {

[Severity: High]
By directly assigning the return value here, does the error pointer become
visible to the cleanup function on failure?

When dma_request_chan fails, sprd_pcm_release_dma_channel() is called
immediately below. That function loops through the channels and checks:

    if (data->chan) {
        dma_release_channel(data->chan);
    }

This condition evaluates to true for an error pointer, blindly passing it to
dma_release_channel. Could this lead to a kernel panic when the invalid pointer
is dereferenced?

>  			dev_err(dev, "failed to request dma channel:%s\n",
>  				dma_params->chan_name[i]);
>  			sprd_pcm_release_dma_channel(substream);
> -			return -ENODEV;
> +			return PTR_ERR(data->chan);
>  		}
>  	}
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260915100931.3593242-1-andriy.shevchenko@linux.intel.com?part=2

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 4/7] ASoC: pxa: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 ` [PATCH v1 4/7] ASoC: pxa: " Andy Shevchenko
@ 2026-09-15 10:21   ` sashiko-bot
  2026-09-15 14:09     ` Andy Shevchenko
  0 siblings, 1 reply; 24+ messages in thread
From: sashiko-bot @ 2026-09-15 10:21 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: dmaengine, vkoul, Frank.Li

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] UAPI: -EPROBE_DEFER leaked to user-space open() via pxa2xx_pcm_open()
--

commit 44587eacc45895505692b413ada6ab4975034283
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

ASoC: pxa: Replace dma_request_slave_channel() by dma_request_chan()

This commit replaces the deprecated dma_request_slave_channel() with
dma_request_chan().

> diff --git a/sound/soc/pxa/pxa2xx-pcm-lib.c b/sound/soc/pxa/pxa2xx-pcm-lib.c
> index 88a9d32263021..0ccf88aa11389 100644
> --- a/sound/soc/pxa/pxa2xx-pcm-lib.c
> +++ b/sound/soc/pxa/pxa2xx-pcm-lib.c
[ ... ]
> @@ -107,9 +108,12 @@ static int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
>  	if (ret < 0)
>  		return ret;
>  
> -	return snd_dmaengine_pcm_open(
> -		substream, dma_request_slave_channel(snd_soc_rtd_to_cpu(rtd, 0)->dev,
> -						     dma_params->chan_name));
> +	chan = dma_request_chan(snd_soc_rtd_to_cpu(rtd, 0)->dev, dma_params->chan_name);
> +	ret = PTR_ERR_OR_ZERO(chan);
> +	if (ret)
> +		return ret;

[Severity: Medium]
Will this leak the kernel-internal -EPROBE_DEFER error code to user-space?

If dma_request_chan() fails because the DMA driver isn't loaded yet, it
can return -EPROBE_DEFER.  Since pxa2xx_pcm_open() returns this directly, 
the -EPROBE_DEFER error code would be passed up to snd_pcm_open() and 
returned to the user-space application calling open() on the ALSA device.

In the old code, dma_request_slave_channel() returned NULL on failure,
and snd_dmaengine_pcm_open() mapped that NULL to -ENXIO. Could we map the
error here to a standard user-facing error like -ENXIO when 
dma_request_chan() fails?

> +
> +	return snd_dmaengine_pcm_open(substream, chan);
>  }
>  
>  static int pxa2xx_pcm_close(struct snd_pcm_substream *substream)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260915100931.3593242-1-andriy.shevchenko@linux.intel.com?part=4

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 6/7] gpib: fmh_gpib: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 ` [PATCH v1 6/7] gpib: fmh_gpib: " Andy Shevchenko
@ 2026-09-15 10:21   ` sashiko-bot
  2026-09-15 14:16     ` Andy Shevchenko
  2026-09-15 14:16   ` Dave Penkler
  1 sibling, 1 reply; 24+ messages in thread
From: sashiko-bot @ 2026-09-15 10:21 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: vkoul, Frank.Li, dmaengine

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] gpib: fmh_gpib: unhandled ERR_PTR from dma_request_chan() causes crash in fmh_gpib_detach()
--

commit 7e5dd98fffd0fbb658150cf070a074a056171a33
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

gpib: fmh_gpib: Replace dma_request_slave_channel() by dma_request_chan()

This commit replaces the deprecated dma_request_slave_channel() with
dma_request_chan(). It updates the error checking to use PTR_ERR_OR_ZERO()
appropriately for the new function.

> diff --git a/drivers/gpib/fmh_gpib/fmh_gpib.c b/drivers/gpib/fmh_gpib/fmh_gpib.c
> index 5e10e9353fedd..3fdcc673ec8b8 100644
> --- a/drivers/gpib/fmh_gpib/fmh_gpib.c
> +++ b/drivers/gpib/fmh_gpib/fmh_gpib.c
> @@ -1458,10 +1458,11 @@ static int fmh_gpib_attach_impl(struct gpib_board *board, const struct gpib_boar
>  	e_priv->irq = irq;
>  
>  	if (acquire_dma) {
> -		e_priv->dma_channel = dma_request_slave_channel(board->dev, "rxtx");
> -		if (!e_priv->dma_channel) {
> +		e_priv->dma_channel = dma_request_chan(board->dev, "rxtx");
> +		retval = PTR_ERR_OR_ZERO(e_priv->dma_channel);
> +		if (retval) {
>  			dev_err(board->dev, "failed to acquire dma channel \"rxtx\".\n");
> -			return -EIO;
> +			return retval;

[Severity: High]
Does this code leave an ERR_PTR in e_priv->dma_channel on failure?

If dma_request_chan() fails, it returns an error pointer which is stored in
e_priv->dma_channel. When fmh_gpib_attach_impl() returns this error code,
the GPIB core intercepts the attach failure and calls fmh_gpib_detach() to
clean up.

Since fmh_gpib_detach() handles cleanup by checking for NULL:

drivers/gpib/fmh_gpib/fmh_gpib.c:fmh_gpib_detach() {
    ...
    if (e_priv) {
        if (e_priv->dma_channel)
            dma_release_channel(e_priv->dma_channel);
    ...
}

It will evaluate the ERR_PTR as true and attempt to dereference it inside
dma_release_channel(), leading to a kernel oops or panic. Should
e_priv->dma_channel be reset to NULL before returning the error?

>  		}
>  	}
>  	/*

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260915100931.3593242-1-andriy.shevchenko@linux.intel.com?part=6

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 5/7] ASoC: fsl_asrc: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 ` [PATCH v1 5/7] ASoC: fsl_asrc: " Andy Shevchenko
@ 2026-09-15 10:25   ` sashiko-bot
  2026-09-15 14:10     ` Andy Shevchenko
  2026-09-15 14:02   ` Frank Li
  2026-09-16  3:30   ` Shengjiu Wang
  2 siblings, 1 reply; 24+ messages in thread
From: sashiko-bot @ 2026-09-15 10:25 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: vkoul, dmaengine, Frank.Li

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] sound: fsl_asrc: dma_release_channel() dereferences ERR_PTR in fsl_asrc_dma_hw_free
--

commit 6b21fbae024779272022d29e64403ad02a43c0a2
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: ASoC: fsl_asrc: Replace dma_request_slave_channel() by dma_request_chan()

This patch replaces the deprecated dma_request_slave_channel() API with
dma_request_chan() across the fsl_asrc driver.

> diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
> index 2f662bdf14d07..5cd12781c6042 100644
> --- a/sound/soc/fsl/fsl_asrc_dma.c
> +++ b/sound/soc/fsl/fsl_asrc_dma.c
> @@ -191,9 +191,10 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component,
>  	dma_params_fe->maxburst = dma_params_be->maxburst;
>  
>  	pair->dma_chan[!dir] = asrc->get_dma_channel(pair, !dir);
> -	if (!pair->dma_chan[!dir]) {
> +	ret = PTR_ERR_OR_ZERO(pair->dma_chan[!dir]);
> +	if (ret) {
>  		dev_err(dev, "failed to request DMA channel\n");
> -		return -EINVAL;
> +		return ret;
>  	}

[Severity: High]
Will this cause a panic in fsl_asrc_dma_hw_free() if get_dma_channel()
fails?

Since dma_request_chan() returns an ERR_PTR on failure, pair->dma_chan[!dir]
will now store an ERR_PTR instead of NULL when the DMA channel request fails.

If hw_params fails here, the ALSA PCM core handles the failure by invoking
the component's hw_free callback to clean up partially allocated resources.
That function checks if the channel pointer is truthy:

sound/soc/fsl/fsl_asrc_dma.c:fsl_asrc_dma_hw_free() {
    ...
    if (pair->dma_chan[!dir])
        dma_release_channel(pair->dma_chan[!dir]);
    ...
}

Since an ERR_PTR evaluates to true, dma_release_channel() is called with the
ERR_PTR, which will cause an invalid memory access and an immediate kernel
panic when it attempts to read chan->client_count.

Does fsl_asrc_dma_hw_free() need to be updated to use IS_ERR_OR_NULL()
instead, or should we reset pair->dma_chan[!dir] to NULL here on failure?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260915100931.3593242-1-andriy.shevchenko@linux.intel.com?part=5

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 3/7] ASoC: soc-generic-dmaengine-pcm: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 ` [PATCH v1 3/7] ASoC: soc-generic-dmaengine-pcm: " Andy Shevchenko
@ 2026-09-15 10:29   ` Cezary Rojewski
  0 siblings, 0 replies; 24+ messages in thread
From: Cezary Rojewski @ 2026-09-15 10:29 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Dave Penkler, Greg Kroah-Hartman, Vinod Koul, Frank Li,
	Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue, Frank Li, Mark Brown,
	Shengjiu Wang, bui duc phuc, Tianchu Chen, linux-kernel,
	dmaengine, linux-sound, linuxppc-dev, linux-arm-kernel,
	linux-stm32

On 9/15/2026 12:04 PM, Andy Shevchenko wrote:
> Replace dma_request_slave_channel() by dma_request_chan() as suggested
> since the former is deprecated.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  sound/soc/soc-generic-dmaengine-pcm.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
> index 65b7ec52a054..6d1dbee8f6c1 100644
> --- a/sound/soc/soc-generic-dmaengine-pcm.c
> +++ b/sound/soc/soc-generic-dmaengine-pcm.c
> @@ -242,9 +242,11 @@ static int dmaengine_pcm_new(struct snd_soc_component *component,
>  		if (!substream)
>  			continue;
>  
> -		if (!pcm->chan[i] && config->chan_names[i])
> -			pcm->chan[i] = dma_request_slave_channel(dev,
> -				config->chan_names[i]);
> +		if (!pcm->chan[i] && config->chan_names[i]) {
> +			pcm->chan[i] = dma_request_chan(dev, config->chan_names[i]);
> +			if (IS_ERR(pcm->chan[i]))
> +				pcm->chan[i] = NULL;
> +		}
>  
>  		if (!pcm->chan[i] && (pcm->flags & SND_DMAENGINE_PCM_FLAG_COMPAT)) {
>  			pcm->chan[i] = dmaengine_pcm_compat_request_channel(

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 ` [PATCH v1 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan() Andy Shevchenko
  2026-09-15 10:19   ` sashiko-bot
@ 2026-09-15 10:54   ` Baolin Wang
  2026-09-15 17:35   ` Mark Brown
  2 siblings, 0 replies; 24+ messages in thread
From: Baolin Wang @ 2026-09-15 10:54 UTC (permalink / raw)
  To: Andy Shevchenko, Frank Li, Mark Brown, Shengjiu Wang,
	bui duc phuc, Tianchu Chen, linux-kernel, dmaengine, linux-sound,
	linuxppc-dev, linux-arm-kernel, linux-stm32
  Cc: Dave Penkler, Greg Kroah-Hartman, Vinod Koul, Frank Li,
	Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen, Maxime Coquelin,
	Alexandre Torgue



On 9/15/26 6:04 PM, Andy Shevchenko wrote:
> Replace dma_request_slave_channel() by dma_request_chan() as suggested
> since the former is deprecated.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

LGTM. Thanks.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 5/7] ASoC: fsl_asrc: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 ` [PATCH v1 5/7] ASoC: fsl_asrc: " Andy Shevchenko
  2026-09-15 10:25   ` sashiko-bot
@ 2026-09-15 14:02   ` Frank Li
  2026-09-16  3:30   ` Shengjiu Wang
  2 siblings, 0 replies; 24+ messages in thread
From: Frank Li @ 2026-09-15 14:02 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Frank Li, Mark Brown, Shengjiu Wang, bui duc phuc, Tianchu Chen,
	linux-kernel, dmaengine, linux-sound, linuxppc-dev,
	linux-arm-kernel, linux-stm32, Dave Penkler, Greg Kroah-Hartman,
	Vinod Koul, Frank Li, Shengjiu Wang, Xiubo Li, Fabio Estevam,
	Nicolin Chen, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Daniel Mack, Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Olivier Moysan,
	Arnaud Pouliquen, Maxime Coquelin, Alexandre Torgue

On Tue, Sep 15, 2026 at 12:04:26PM +0200, Andy Shevchenko wrote:
> Replace dma_request_slave_channel() by dma_request_chan() as suggested
> since the former is deprecated.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  sound/soc/fsl/fsl_asrc.c     |  2 +-
>  sound/soc/fsl/fsl_asrc_dma.c | 13 +++++++------
>  sound/soc/fsl/fsl_asrc_m2m.c |  8 ++++----
>  sound/soc/fsl/fsl_easrc.c    |  2 +-
>  4 files changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
> index b24737add001..ae682bf450f6 100644
> --- a/sound/soc/fsl/fsl_asrc.c
> +++ b/sound/soc/fsl/fsl_asrc.c
> @@ -638,7 +638,7 @@ static struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair,
>
>  	sprintf(name, "%cx%c", dir == IN ? 'r' : 't', index + 'a');
>
> -	return dma_request_slave_channel(&asrc->pdev->dev, name);
> +	return dma_request_chan(&asrc->pdev->dev, name);
>  }
>
>  static int fsl_asrc_dai_startup(struct snd_pcm_substream *substream,
> diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
> index 2f662bdf14d0..5cd12781c604 100644
> --- a/sound/soc/fsl/fsl_asrc_dma.c
> +++ b/sound/soc/fsl/fsl_asrc_dma.c
> @@ -191,9 +191,10 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component,
>  	dma_params_fe->maxburst = dma_params_be->maxburst;
>
>  	pair->dma_chan[!dir] = asrc->get_dma_channel(pair, !dir);
> -	if (!pair->dma_chan[!dir]) {
> +	ret = PTR_ERR_OR_ZERO(pair->dma_chan[!dir]);
> +	if (ret) {
>  		dev_err(dev, "failed to request DMA channel\n");
> -		return -EINVAL;
> +		return ret;


It progagate error to caller, it should be okay. I think it'd better
mention at commit message

Frank

>  	}
>
>  	ret = snd_dmaengine_pcm_prepare_slave_config(substream, params, &config_fe);
> @@ -404,9 +405,9 @@ static int fsl_asrc_dma_startup(struct snd_soc_component *component,
>
>  	/* Request a dummy dma channel, which will be released later. */
>  	tmp_chan = asrc->get_dma_channel(pair, dir);
> -	if (!tmp_chan) {
> +	ret = PTR_ERR_OR_ZERO(tmp_chan);
> +	if (ret) {
>  		dev_err(dev, "failed to get dma channel\n");
> -		ret = -EINVAL;
>  		goto dma_chan_err;
>  	}
>
> @@ -497,9 +498,9 @@ static int fsl_asrc_dma_pcm_new(struct snd_soc_component *component,
>
>  	/* Request a dma channel, which will be released later. */
>  	chan = asrc->get_dma_channel(pair, IN);
> -	if (!chan) {
> +	ret = PTR_ERR_OR_ZERO(chan);
> +	if (ret) {
>  		dev_err(dev, "failed to get dma channel\n");
> -		ret = -EINVAL;
>  		goto dma_chan_err;
>  	}
>
> diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
> index 4bc40f328f58..e440cc083ebb 100644
> --- a/sound/soc/fsl/fsl_asrc_m2m.c
> +++ b/sound/soc/fsl/fsl_asrc_m2m.c
> @@ -503,16 +503,16 @@ static int fsl_asrc_m2m_comp_task_create(struct snd_compr_stream *stream,
>
>  	/* Request dma channels */
>  	pair->dma_chan[IN] = asrc->get_dma_channel(pair, IN);
> -	if (!pair->dma_chan[IN]) {
> +	ret = PTR_ERR_OR_ZERO(pair->dma_chan[IN]);
> +	if (ret) {
>  		dev_err(dev, "[ctx%d] failed to get input DMA channel\n", pair->index);
> -		ret = -EBUSY;
>  		goto err_dma_channel_in;
>  	}
>
>  	pair->dma_chan[OUT] = asrc->get_dma_channel(pair, OUT);
> -	if (!pair->dma_chan[OUT]) {
> +	ret = PTR_ERR_OR_ZERO(pair->dma_chan[OUT]);
> +	if (ret) {
>  		dev_err(dev, "[ctx%d] failed to get output DMA channel\n", pair->index);
> -		ret = -EBUSY;
>  		goto err_dma_channel_out;
>  	}
>
> diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c
> index aced16d1228a..d30cc3e90215 100644
> --- a/sound/soc/fsl/fsl_easrc.c
> +++ b/sound/soc/fsl/fsl_easrc.c
> @@ -1433,7 +1433,7 @@ static struct dma_chan *fsl_easrc_get_dma_channel(struct fsl_asrc_pair *ctx,
>  	/* Example of dma name: ctx0_rx */
>  	sprintf(name, "ctx%c_%cx", index + '0', dir == IN ? 'r' : 't');
>
> -	return dma_request_slave_channel(&easrc->pdev->dev, name);
> +	return dma_request_chan(&easrc->pdev->dev, name);
>  };
>
>  static const unsigned int easrc_rates[] = {
> --
> 2.50.1
>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 7/7] dmaengine: Remove deprecated dma_request_slave_channel()
  2026-09-15 10:04 ` [PATCH v1 7/7] dmaengine: Remove deprecated dma_request_slave_channel() Andy Shevchenko
@ 2026-09-15 14:03   ` Frank Li
  2026-09-15 17:37   ` Vinod Koul
  1 sibling, 0 replies; 24+ messages in thread
From: Frank Li @ 2026-09-15 14:03 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Frank Li, Mark Brown, Shengjiu Wang, bui duc phuc, Tianchu Chen,
	linux-kernel, dmaengine, linux-sound, linuxppc-dev,
	linux-arm-kernel, linux-stm32, Dave Penkler, Greg Kroah-Hartman,
	Vinod Koul, Frank Li, Shengjiu Wang, Xiubo Li, Fabio Estevam,
	Nicolin Chen, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Daniel Mack, Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Olivier Moysan,
	Arnaud Pouliquen, Maxime Coquelin, Alexandre Torgue

On Tue, Sep 15, 2026 at 12:04:28PM +0200, Andy Shevchenko wrote:
> No more users.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  include/linux/dmaengine.h | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index c50497ecd52d..7596ebdac466 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -1763,15 +1763,6 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
>  #define dma_request_channel(mask, x, y) \
>  	__dma_request_channel(&(mask), x, y, NULL)
>
> -/* Deprecated, please use dma_request_chan() directly */
> -static inline struct dma_chan * __deprecated
> -dma_request_slave_channel(struct device *dev, const char *name)
> -{
> -	struct dma_chan *ch = dma_request_chan(dev, name);
> -
> -	return IS_ERR(ch) ? NULL : ch;
> -}
> -
>  static inline struct dma_chan
>  *dma_request_slave_channel_compat(const dma_cap_mask_t mask,
>  				  dma_filter_fn fn, void *fn_param,
> --
> 2.50.1
>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:19   ` sashiko-bot
@ 2026-09-15 14:04     ` Andy Shevchenko
  0 siblings, 0 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-09-15 14:04 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: Frank.Li, vkoul, dmaengine

On Tue, Sep 15, 2026 at 10:19:24AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] ASoC: sprd: crash in dma_release_channel() due to ERR_PTR leak
> --
> 
> commit 5e4c398ebe4c03b68c30e555198977e4ad4905e4
> Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan()
> 
> This commit replaces deprecated dma_request_slave_channel calls with
> dma_request_chan. It updates the error checking from NULL checks to
> IS_ERR.
> 
> > diff --git a/sound/soc/sprd/sprd-pcm-compress.c b/sound/soc/sprd/sprd-pcm-compress.c
> > index e5249924b54d9..5613c25fffd73 100644
> > --- a/sound/soc/sprd/sprd-pcm-compress.c
> > +++ b/sound/soc/sprd/sprd-pcm-compress.c
> > @@ -153,11 +153,10 @@ static int sprd_platform_compr_dma_config(struct snd_soc_component *component,
> >  		return -EINVAL;
> >  	}
> >  
> > -	dma->chan = dma_request_slave_channel(dev,
> > -					      dma_params->chan_name[channel]);
> > -	if (!dma->chan) {
> > +	dma->chan = dma_request_chan(dev, dma_params->chan_name[channel]);
> > +	if (IS_ERR(dma->chan)) {
> 
> [Severity: High]
> If dma_request_chan fails, does this leak the error pointer into the compress
> stream's persistent dma array?
> 
> When the file descriptor is closed or cleaned up, the free path in
> sprd_platform_compr_free() will attempt to release the channel:
> 
>     if (dma->chan) {
>         dma_release_channel(dma->chan);
>         dma->chan = NULL;
>     }
> 
> Since the error path doesn't clear the error pointer from dma->chan, the if
> check evaluates to true. Will dma_release_channel() then dereference the error
> pointer and crash?

> >  		dev_err(dev, "failed to request dma channel\n");
> > -		return -ENODEV;
> > +		return PTR_ERR(dma->chan);
> >  	}

Granted, I will add an amendment to dma_release_chan() to be NULL and ERR_PTR
aware.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 4/7] ASoC: pxa: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:21   ` sashiko-bot
@ 2026-09-15 14:09     ` Andy Shevchenko
  0 siblings, 0 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-09-15 14:09 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: dmaengine, vkoul, Frank.Li

On Tue, Sep 15, 2026 at 10:21:28AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] UAPI: -EPROBE_DEFER leaked to user-space open() via pxa2xx_pcm_open()
> --

[ ... ]

> > -	return snd_dmaengine_pcm_open(
> > -		substream, dma_request_slave_channel(snd_soc_rtd_to_cpu(rtd, 0)->dev,
> > -						     dma_params->chan_name));
> > +	chan = dma_request_chan(snd_soc_rtd_to_cpu(rtd, 0)->dev, dma_params->chan_name);
> > +	ret = PTR_ERR_OR_ZERO(chan);
> > +	if (ret)
> > +		return ret;
> 
> [Severity: Medium]
> Will this leak the kernel-internal -EPROBE_DEFER error code to user-space?
> 
> If dma_request_chan() fails because the DMA driver isn't loaded yet, it
> can return -EPROBE_DEFER.  Since pxa2xx_pcm_open() returns this directly, 
> the -EPROBE_DEFER error code would be passed up to snd_pcm_open() and 
> returned to the user-space application calling open() on the ALSA device.
> 
> In the old code, dma_request_slave_channel() returned NULL on failure,
> and snd_dmaengine_pcm_open() mapped that NULL to -ENXIO. Could we map the
> error here to a standard user-facing error like -ENXIO when 
> dma_request_chan() fails?

Sure, makes sense.

> > +	return snd_dmaengine_pcm_open(substream, chan);

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 5/7] ASoC: fsl_asrc: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:25   ` sashiko-bot
@ 2026-09-15 14:10     ` Andy Shevchenko
  0 siblings, 0 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-09-15 14:10 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: vkoul, dmaengine, Frank.Li

On Tue, Sep 15, 2026 at 10:25:12AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] sound: fsl_asrc: dma_release_channel() dereferences ERR_PTR in fsl_asrc_dma_hw_free

Same answer as per patch 2.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 6/7] gpib: fmh_gpib: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 ` [PATCH v1 6/7] gpib: fmh_gpib: " Andy Shevchenko
  2026-09-15 10:21   ` sashiko-bot
@ 2026-09-15 14:16   ` Dave Penkler
  1 sibling, 0 replies; 24+ messages in thread
From: Dave Penkler @ 2026-09-15 14:16 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Frank Li, Mark Brown, Shengjiu Wang, bui duc phuc, Tianchu Chen,
	linux-kernel, dmaengine, linux-sound, linuxppc-dev,
	linux-arm-kernel, linux-stm32, Greg Kroah-Hartman, Vinod Koul,
	Frank Li, Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue

On Tue, Sep 15, 2026 at 12:04:27PM +0200, Andy Shevchenko wrote:
> Replace dma_request_slave_channel() by dma_request_chan() as suggested
> since the former is deprecated.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpib/fmh_gpib/fmh_gpib.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpib/fmh_gpib/fmh_gpib.c b/drivers/gpib/fmh_gpib/fmh_gpib.c
> index 5e10e9353fed..3fdcc673ec8b 100644
> --- a/drivers/gpib/fmh_gpib/fmh_gpib.c
> +++ b/drivers/gpib/fmh_gpib/fmh_gpib.c
> @@ -1458,10 +1458,11 @@ static int fmh_gpib_attach_impl(struct gpib_board *board, const struct gpib_boar
>  	e_priv->irq = irq;
>  
>  	if (acquire_dma) {
> -		e_priv->dma_channel = dma_request_slave_channel(board->dev, "rxtx");
> -		if (!e_priv->dma_channel) {
> +		e_priv->dma_channel = dma_request_chan(board->dev, "rxtx");
> +		retval = PTR_ERR_OR_ZERO(e_priv->dma_channel);
> +		if (retval) {
>  			dev_err(board->dev, "failed to acquire dma channel \"rxtx\".\n");
> -			return -EIO;
> +			return retval;
>  		}
>  	}

Reviewed-by: Dave Penkler <dpenkler@gmail.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 6/7] gpib: fmh_gpib: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:21   ` sashiko-bot
@ 2026-09-15 14:16     ` Andy Shevchenko
  0 siblings, 0 replies; 24+ messages in thread
From: Andy Shevchenko @ 2026-09-15 14:16 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: vkoul, Frank.Li, dmaengine

On Tue, Sep 15, 2026 at 10:21:44AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] gpib: fmh_gpib: unhandled ERR_PTR from dma_request_chan() causes crash in fmh_gpib_detach()

Same as per patch 2.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 ` [PATCH v1 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan() Andy Shevchenko
  2026-09-15 10:19   ` sashiko-bot
  2026-09-15 10:54   ` Baolin Wang
@ 2026-09-15 17:35   ` Mark Brown
  2 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2026-09-15 17:35 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Frank Li, Shengjiu Wang, bui duc phuc, Tianchu Chen, linux-kernel,
	dmaengine, linux-sound, linuxppc-dev, linux-arm-kernel,
	linux-stm32, Dave Penkler, Greg Kroah-Hartman, Vinod Koul,
	Frank Li, Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue

[-- Attachment #1: Type: text/plain, Size: 1037 bytes --]

On Tue, Sep 15, 2026 at 12:04:23PM +0200, Andy Shevchenko wrote:
> Replace dma_request_slave_channel() by dma_request_chan() as suggested
> since the former is deprecated.

> @@ -171,13 +171,12 @@ static int sprd_pcm_request_dma_channel(struct snd_soc_component *component,
>  	for (i = 0; i < channels; i++) {
>  		struct sprd_pcm_dma_data *data = &dma_private->data[i];
>  
> -		data->chan = dma_request_slave_channel(dev,
> -						       dma_params->chan_name[i]);
> -		if (!data->chan) {
> +		data->chan = dma_request_chan(dev, dma_params->chan_name[i]);
> +		if (IS_ERR(data->chan)) {
>  			dev_err(dev, "failed to request dma channel:%s\n",
>  				dma_params->chan_name[i]);
>  			sprd_pcm_release_dma_channel(substream);
> -			return -ENODEV;
> +			return PTR_ERR(data->chan);

sprd_pcm_release_dma_channel() does:

                if (data->chan) {
                        dma_release_channel(data->chan);
                        data->chan = NULL;

so this won't DTRT with propagating the return code.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 7/7] dmaengine: Remove deprecated dma_request_slave_channel()
  2026-09-15 10:04 ` [PATCH v1 7/7] dmaengine: Remove deprecated dma_request_slave_channel() Andy Shevchenko
  2026-09-15 14:03   ` Frank Li
@ 2026-09-15 17:37   ` Vinod Koul
  1 sibling, 0 replies; 24+ messages in thread
From: Vinod Koul @ 2026-09-15 17:37 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Frank Li, Mark Brown, Shengjiu Wang, bui duc phuc, Tianchu Chen,
	linux-kernel, dmaengine, linux-sound, linuxppc-dev,
	linux-arm-kernel, linux-stm32, Dave Penkler, Greg Kroah-Hartman,
	Frank Li, Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue

On 15-09-26, 12:04, Andy Shevchenko wrote:
> No more users.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Vinod Koul <vkoul@kernel.org>

-- 
~Vinod

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v1 5/7] ASoC: fsl_asrc: Replace dma_request_slave_channel() by dma_request_chan()
  2026-09-15 10:04 ` [PATCH v1 5/7] ASoC: fsl_asrc: " Andy Shevchenko
  2026-09-15 10:25   ` sashiko-bot
  2026-09-15 14:02   ` Frank Li
@ 2026-09-16  3:30   ` Shengjiu Wang
  2 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2026-09-16  3:30 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Frank Li, Mark Brown, Shengjiu Wang, bui duc phuc, Tianchu Chen,
	linux-kernel, dmaengine, linux-sound, linuxppc-dev,
	linux-arm-kernel, linux-stm32, Dave Penkler, Greg Kroah-Hartman,
	Vinod Koul, Frank Li, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Lars-Peter Clausen, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Olivier Moysan, Arnaud Pouliquen,
	Maxime Coquelin, Alexandre Torgue

On Tue, Sep 15, 2026 at 6:09 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> Replace dma_request_slave_channel() by dma_request_chan() as suggested
> since the former is deprecated.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Shengjiu Wang <shengjiu.wang@gmail.com>

Best regards
Shengjiu Wang
> ---
>  sound/soc/fsl/fsl_asrc.c     |  2 +-
>  sound/soc/fsl/fsl_asrc_dma.c | 13 +++++++------
>  sound/soc/fsl/fsl_asrc_m2m.c |  8 ++++----
>  sound/soc/fsl/fsl_easrc.c    |  2 +-
>  4 files changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
> index b24737add001..ae682bf450f6 100644
> --- a/sound/soc/fsl/fsl_asrc.c
> +++ b/sound/soc/fsl/fsl_asrc.c
> @@ -638,7 +638,7 @@ static struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair,
>
>         sprintf(name, "%cx%c", dir == IN ? 'r' : 't', index + 'a');
>
> -       return dma_request_slave_channel(&asrc->pdev->dev, name);
> +       return dma_request_chan(&asrc->pdev->dev, name);
>  }
>
>  static int fsl_asrc_dai_startup(struct snd_pcm_substream *substream,
> diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
> index 2f662bdf14d0..5cd12781c604 100644
> --- a/sound/soc/fsl/fsl_asrc_dma.c
> +++ b/sound/soc/fsl/fsl_asrc_dma.c
> @@ -191,9 +191,10 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component,
>         dma_params_fe->maxburst = dma_params_be->maxburst;
>
>         pair->dma_chan[!dir] = asrc->get_dma_channel(pair, !dir);
> -       if (!pair->dma_chan[!dir]) {
> +       ret = PTR_ERR_OR_ZERO(pair->dma_chan[!dir]);
> +       if (ret) {
>                 dev_err(dev, "failed to request DMA channel\n");
> -               return -EINVAL;
> +               return ret;
>         }
>
>         ret = snd_dmaengine_pcm_prepare_slave_config(substream, params, &config_fe);
> @@ -404,9 +405,9 @@ static int fsl_asrc_dma_startup(struct snd_soc_component *component,
>
>         /* Request a dummy dma channel, which will be released later. */
>         tmp_chan = asrc->get_dma_channel(pair, dir);
> -       if (!tmp_chan) {
> +       ret = PTR_ERR_OR_ZERO(tmp_chan);
> +       if (ret) {
>                 dev_err(dev, "failed to get dma channel\n");
> -               ret = -EINVAL;
>                 goto dma_chan_err;
>         }
>
> @@ -497,9 +498,9 @@ static int fsl_asrc_dma_pcm_new(struct snd_soc_component *component,
>
>         /* Request a dma channel, which will be released later. */
>         chan = asrc->get_dma_channel(pair, IN);
> -       if (!chan) {
> +       ret = PTR_ERR_OR_ZERO(chan);
> +       if (ret) {
>                 dev_err(dev, "failed to get dma channel\n");
> -               ret = -EINVAL;
>                 goto dma_chan_err;
>         }
>
> diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
> index 4bc40f328f58..e440cc083ebb 100644
> --- a/sound/soc/fsl/fsl_asrc_m2m.c
> +++ b/sound/soc/fsl/fsl_asrc_m2m.c
> @@ -503,16 +503,16 @@ static int fsl_asrc_m2m_comp_task_create(struct snd_compr_stream *stream,
>
>         /* Request dma channels */
>         pair->dma_chan[IN] = asrc->get_dma_channel(pair, IN);
> -       if (!pair->dma_chan[IN]) {
> +       ret = PTR_ERR_OR_ZERO(pair->dma_chan[IN]);
> +       if (ret) {
>                 dev_err(dev, "[ctx%d] failed to get input DMA channel\n", pair->index);
> -               ret = -EBUSY;
>                 goto err_dma_channel_in;
>         }
>
>         pair->dma_chan[OUT] = asrc->get_dma_channel(pair, OUT);
> -       if (!pair->dma_chan[OUT]) {
> +       ret = PTR_ERR_OR_ZERO(pair->dma_chan[OUT]);
> +       if (ret) {
>                 dev_err(dev, "[ctx%d] failed to get output DMA channel\n", pair->index);
> -               ret = -EBUSY;
>                 goto err_dma_channel_out;
>         }
>
> diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c
> index aced16d1228a..d30cc3e90215 100644
> --- a/sound/soc/fsl/fsl_easrc.c
> +++ b/sound/soc/fsl/fsl_easrc.c
> @@ -1433,7 +1433,7 @@ static struct dma_chan *fsl_easrc_get_dma_channel(struct fsl_asrc_pair *ctx,
>         /* Example of dma name: ctx0_rx */
>         sprintf(name, "ctx%c_%cx", index + '0', dir == IN ? 'r' : 't');
>
> -       return dma_request_slave_channel(&easrc->pdev->dev, name);
> +       return dma_request_chan(&easrc->pdev->dev, name);
>  };
>
>  static const unsigned int easrc_rates[] = {
> --
> 2.50.1
>

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2026-09-16  3:30 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 10:04 [PATCH v1 0/7] ASoC et alia: Convert to use dma_request_chan() Andy Shevchenko
2026-09-15 10:04 ` [PATCH v1 1/7] ASoC: stm32: spdifrx: Drop mention of the deprecated and unused call Andy Shevchenko
2026-09-15 10:04 ` [PATCH v1 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan() Andy Shevchenko
2026-09-15 10:19   ` sashiko-bot
2026-09-15 14:04     ` Andy Shevchenko
2026-09-15 10:54   ` Baolin Wang
2026-09-15 17:35   ` Mark Brown
2026-09-15 10:04 ` [PATCH v1 3/7] ASoC: soc-generic-dmaengine-pcm: " Andy Shevchenko
2026-09-15 10:29   ` Cezary Rojewski
2026-09-15 10:04 ` [PATCH v1 4/7] ASoC: pxa: " Andy Shevchenko
2026-09-15 10:21   ` sashiko-bot
2026-09-15 14:09     ` Andy Shevchenko
2026-09-15 10:04 ` [PATCH v1 5/7] ASoC: fsl_asrc: " Andy Shevchenko
2026-09-15 10:25   ` sashiko-bot
2026-09-15 14:10     ` Andy Shevchenko
2026-09-15 14:02   ` Frank Li
2026-09-16  3:30   ` Shengjiu Wang
2026-09-15 10:04 ` [PATCH v1 6/7] gpib: fmh_gpib: " Andy Shevchenko
2026-09-15 10:21   ` sashiko-bot
2026-09-15 14:16     ` Andy Shevchenko
2026-09-15 14:16   ` Dave Penkler
2026-09-15 10:04 ` [PATCH v1 7/7] dmaengine: Remove deprecated dma_request_slave_channel() Andy Shevchenko
2026-09-15 14:03   ` Frank Li
2026-09-15 17:37   ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.