diff mbox series

[v1,2/4] dmaengine: Use dma_request_channel() instead of __dma_request_channel()

Message ID 20241007150852.2183722-3-andriy.shevchenko@linux.intel.com (mailing list archive)
State Superseded
Headers show
Series dmaengine: dma_request_chan*() amendments | expand

Commit Message

Andy Shevchenko Oct. 7, 2024, 3:06 p.m. UTC
Let's reduce the surface of the use of __dma_request_channel().
Hopefully we can make it internall to the DMA drivers or kill for good
completely.

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

Comments

Frank Li Oct. 7, 2024, 4:01 p.m. UTC | #1
On Mon, Oct 07, 2024 at 06:06:46PM +0300, Andy Shevchenko wrote:
> Let's reduce the surface of the use of __dma_request_channel().
> Hopefully we can make it internall to the DMA drivers or kill for good
> completely.

Suggest:

Reduce use internal __dma_request_channel() function in public
dmaengine.h

I think this change is okay, but I hope the following patches, which make
__dma_request_channel() as internal only. otherwise, it looks not necessary.

Frank

>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  include/linux/dmaengine.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index b4e6de892d34..2f46056096d6 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -1639,7 +1639,7 @@ static inline struct dma_chan
>  	if (!fn || !fn_param)
>  		return NULL;
>
> -	return __dma_request_channel(&mask, fn, fn_param, NULL);
> +	return dma_request_channel(mask, fn, fn_param);
>  }
>
>  static inline char *
> --
> 2.43.0.rc1.1336.g36b5255a03ac
>
Andy Shevchenko Oct. 8, 2024, 5:12 p.m. UTC | #2
On Mon, Oct 07, 2024 at 12:01:22PM -0400, Frank Li wrote:
> On Mon, Oct 07, 2024 at 06:06:46PM +0300, Andy Shevchenko wrote:
> > Let's reduce the surface of the use of __dma_request_channel().
> > Hopefully we can make it internall to the DMA drivers or kill for good
> > completely.
> 
> Suggest:
> 
> Reduce use internal __dma_request_channel() function in public
> dmaengine.h

Okay.

> I think this change is okay, but I hope the following patches, which make
> __dma_request_channel() as internal only. otherwise, it looks not necessary.

As explained in the commit message it's the first baby step to this
direction. But sure, when I have more time I'll continue. In any case
I think this change is good on this own as it shows the use inside the
header.  The people who want to have an example of the use may wrongly
take the existing code as "good to go" and this even might pass the
review somewhere. That said, it's not only reducing the use, but has an
educational purpose as well.
diff mbox series

Patch

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index b4e6de892d34..2f46056096d6 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -1639,7 +1639,7 @@  static inline struct dma_chan
 	if (!fn || !fn_param)
 		return NULL;
 
-	return __dma_request_channel(&mask, fn, fn_param, NULL);
+	return dma_request_channel(mask, fn, fn_param);
 }
 
 static inline char *