[PATCH v1 1/4] dmaengine: Replace dma_request_slave_channel() by dma_request_chan()

Andy Shevchenko posted 4 patches 1 month, 3 weeks ago
There is a newer version of this series
[PATCH v1 1/4] dmaengine: Replace dma_request_slave_channel() by dma_request_chan()
Posted by Andy Shevchenko 1 month, 3 weeks ago
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/dma/imx-sdma.c    | 5 ++---
 include/linux/dmaengine.h | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 72299a08af44..3a769934c984 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1459,9 +1459,8 @@ static int sdma_alloc_chan_resources(struct dma_chan *chan)
 	 * dmatest, thus create 'struct imx_dma_data mem_data' for this case.
 	 * Please note in any other slave case, you have to setup chan->private
 	 * with 'struct imx_dma_data' in your own filter function if you want to
-	 * request dma channel by dma_request_channel() rather than
-	 * dma_request_slave_channel(). Othwise, 'MEMCPY in case?' will appear
-	 * to warn you to correct your filter function.
+	 * request DMA channel by dma_request_channel(), otherwise, 'MEMCPY in
+	 * case?' will appear to warn you to correct your filter function.
 	 */
 	if (!data) {
 		dev_dbg(sdmac->sdma->dev, "MEMCPY in case?\n");
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index b137fdb56093..b4e6de892d34 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -1632,8 +1632,8 @@ static inline struct dma_chan
 {
 	struct dma_chan *chan;
 
-	chan = dma_request_slave_channel(dev, name);
-	if (chan)
+	chan = dma_request_chan(dev, name);
+	if (!IS_ERR(chan))
 		return chan;
 
 	if (!fn || !fn_param)
-- 
2.43.0.rc1.1336.g36b5255a03ac
Re: [PATCH v1 1/4] dmaengine: Replace dma_request_slave_channel() by dma_request_chan()
Posted by Frank Li 1 month, 3 weeks ago
On Mon, Oct 07, 2024 at 06:06:45PM +0300, 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/dma/imx-sdma.c    | 5 ++---
>  include/linux/dmaengine.h | 4 ++--
>  2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 72299a08af44..3a769934c984 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1459,9 +1459,8 @@ static int sdma_alloc_chan_resources(struct dma_chan *chan)
>  	 * dmatest, thus create 'struct imx_dma_data mem_data' for this case.
>  	 * Please note in any other slave case, you have to setup chan->private
>  	 * with 'struct imx_dma_data' in your own filter function if you want to
> -	 * request dma channel by dma_request_channel() rather than
> -	 * dma_request_slave_channel(). Othwise, 'MEMCPY in case?' will appear
> -	 * to warn you to correct your filter function.
> +	 * request DMA channel by dma_request_channel(), otherwise, 'MEMCPY in
> +	 * case?' will appear to warn you to correct your filter function.

It just change comments, why combined with dmaengine.h change.

Frank

>  	 */
>  	if (!data) {
>  		dev_dbg(sdmac->sdma->dev, "MEMCPY in case?\n");
> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index b137fdb56093..b4e6de892d34 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -1632,8 +1632,8 @@ static inline struct dma_chan
>  {
>  	struct dma_chan *chan;
>
> -	chan = dma_request_slave_channel(dev, name);
> -	if (chan)
> +	chan = dma_request_chan(dev, name);
> +	if (!IS_ERR(chan))
>  		return chan;
>
>  	if (!fn || !fn_param)
> --
> 2.43.0.rc1.1336.g36b5255a03ac
>
Re: [PATCH v1 1/4] dmaengine: Replace dma_request_slave_channel() by dma_request_chan()
Posted by Andy Shevchenko 1 month, 2 weeks ago
On Mon, Oct 07, 2024 at 11:52:21AM -0400, Frank Li wrote:
> On Mon, Oct 07, 2024 at 06:06:45PM +0300, Andy Shevchenko wrote:

...

> >  	 * Please note in any other slave case, you have to setup chan->private
> >  	 * with 'struct imx_dma_data' in your own filter function if you want to
> > -	 * request dma channel by dma_request_channel() rather than
> > -	 * dma_request_slave_channel(). Othwise, 'MEMCPY in case?' will appear
> > -	 * to warn you to correct your filter function.
> > +	 * request DMA channel by dma_request_channel(), otherwise, 'MEMCPY in
> > +	 * case?' will appear to warn you to correct your filter function.
> 
> It just change comments, why combined with dmaengine.h change.

Because this comment is related to what is done below.

...

> >  	struct dma_chan *chan;
> >
> > -	chan = dma_request_slave_channel(dev, name);
> > -	if (chan)
> > +	chan = dma_request_chan(dev, name);

Here is no more dma_request_slave_channel() calls as in the mentioned
comment.

> > +	if (!IS_ERR(chan))
> >  		return chan;

-- 
With Best Regards,
Andy Shevchenko