All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Frank Li <Frank.Li@nxp.com>, Mark Brown <broonie@kernel.org>,
	Shengjiu Wang <shengjiu.wang@nxp.com>,
	bui duc phuc <phucduc.bui@gmail.com>,
	Tianchu Chen <flynnnchen@tencent.com>,
	linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org,
	linux-sound@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	Dave Penkler <dpenkler@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
	Shengjiu Wang <shengjiu.wang@gmail.com>,
	Xiubo Li <Xiubo.Lee@gmail.com>,
	Fabio Estevam <festevam@gmail.com>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Daniel Mack <daniel@zonque.org>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Olivier Moysan <olivier.moysan@foss.st.com>,
	Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>
Subject: Re: [PATCH v1 5/7] ASoC: fsl_asrc: Replace dma_request_slave_channel() by dma_request_chan()
Date: Tue, 15 Sep 2026 09:02:59 -0500	[thread overview]
Message-ID: <aqlQEw57-XJavFBL@SMW015318> (raw)
In-Reply-To: <20260915100931.3593242-6-andriy.shevchenko@linux.intel.com>

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
>

  parent reply	other threads:[~2026-09-15 14:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aqlQEw57-XJavFBL@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=Frank.Li@nxp.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnaud.pouliquen@foss.st.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=broonie@kernel.org \
    --cc=daniel@zonque.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=dpenkler@gmail.com \
    --cc=festevam@gmail.com \
    --cc=flynnnchen@tencent.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=nicoleotsuka@gmail.com \
    --cc=olivier.moysan@foss.st.com \
    --cc=orsonzhai@gmail.com \
    --cc=perex@perex.cz \
    --cc=phucduc.bui@gmail.com \
    --cc=robert.jarzmik@free.fr \
    --cc=shengjiu.wang@gmail.com \
    --cc=shengjiu.wang@nxp.com \
    --cc=tiwai@suse.com \
    --cc=vkoul@kernel.org \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.