[PATCH] drivers: dma: refactor: rename dma_ops to dma_device_ops.

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Sep 15 02:02:12 PDT 2025


Hi,

On 9/14/25 9:32 PM, chalianis1 at gmail.com wrote:
> From: Chali Anis <chalianis1 at gmail.com>
> 
> This patch is an esthetic cleanup, rename the dma_ops to dma_device_ops
> to be sure that the struct in drivers/dma is different from one used in
> arch/riscv/cpu. I accidentally faced the issue telling that the struct is
> defined in the two places but it is not supposed to happen since the
> the driver is never selected from riscv.

If it's only about resolving the conflicting names, I'd rather rename
dma_ops for RISC-V to dma_map_ops instead.

Cheers,
Ahmad

> 
> Signed-off-by: Chali Anis <chalianis1 at gmail.com>
> ---
>  drivers/dma/dma-devices.c      | 18 +++++++++---------
>  drivers/dma/ti/k3-udma-am62l.c |  2 +-
>  drivers/dma/ti/k3-udma.c       |  2 +-
>  include/dma-devices.h          |  4 ++--
>  4 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/dma/dma-devices.c b/drivers/dma/dma-devices.c
> index a8b8086d5f86..43e585175a94 100644
> --- a/drivers/dma/dma-devices.c
> +++ b/drivers/dma/dma-devices.c
> @@ -35,7 +35,7 @@ static int dma_of_xlate_default(struct dma *dma,
>  
>  static int dma_request(struct device *dev, struct dma *dma)
>  {
> -	const struct dma_ops *ops = dma->dmad->ops;
> +	const struct dma_device_ops *ops = dma->dmad->ops;
>  
>  	dev_dbg(dma->dev, "%s(dev=%p, dma=%p)\n", __func__, dev, dma);
>  
> @@ -61,7 +61,7 @@ struct dma *dma_get_by_index(struct device *dev, int index)
>  {
>  	int ret;
>  	struct of_phandle_args args;
> -	const struct dma_ops *ops;
> +	const struct dma_device_ops *ops;
>  	struct dma *dma;
>  	struct dma_device *dmad;
>  
> @@ -120,7 +120,7 @@ struct dma *dma_get_by_name(struct device *dev, const char *name)
>  
>  int dma_release(struct dma *dma)
>  {
> -	const struct dma_ops *ops = dma->dmad->ops;
> +	const struct dma_device_ops *ops = dma->dmad->ops;
>  
>  	dev_dbg(dma->dev, "%s(dma=%p)\n", __func__, dma);
>  
> @@ -132,7 +132,7 @@ int dma_release(struct dma *dma)
>  
>  int dma_enable(struct dma *dma)
>  {
> -	const struct dma_ops *ops = dma->dmad->ops;
> +	const struct dma_device_ops *ops = dma->dmad->ops;
>  
>  	dev_dbg(dma->dev, "%s(dma=%p)\n", __func__, dma);
>  
> @@ -144,7 +144,7 @@ int dma_enable(struct dma *dma)
>  
>  int dma_disable(struct dma *dma)
>  {
> -	const struct dma_ops *ops = dma->dmad->ops;
> +	const struct dma_device_ops *ops = dma->dmad->ops;
>  
>  	dev_dbg(dma->dev, "%s(dma=%p)\n", __func__, dma);
>  
> @@ -156,7 +156,7 @@ int dma_disable(struct dma *dma)
>  
>  int dma_prepare_rcv_buf(struct dma *dma, dma_addr_t dst, size_t size)
>  {
> -	const struct dma_ops *ops = dma->dmad->ops;
> +	const struct dma_device_ops *ops = dma->dmad->ops;
>  
>  	dev_vdbg(dma->dev, "%s(dma=%p)\n", __func__, dma);
>  
> @@ -168,7 +168,7 @@ int dma_prepare_rcv_buf(struct dma *dma, dma_addr_t dst, size_t size)
>  
>  int dma_receive(struct dma *dma, dma_addr_t *dst, void *metadata)
>  {
> -	const struct dma_ops *ops = dma->dmad->ops;
> +	const struct dma_device_ops *ops = dma->dmad->ops;
>  
>  	dev_vdbg(dma->dev, "%s(dma=%p)\n", __func__, dma);
>  
> @@ -180,7 +180,7 @@ int dma_receive(struct dma *dma, dma_addr_t *dst, void *metadata)
>  
>  int dma_send(struct dma *dma, dma_addr_t src, size_t len, void *metadata)
>  {
> -	const struct dma_ops *ops = dma->dmad->ops;
> +	const struct dma_device_ops *ops = dma->dmad->ops;
>  
>  	dev_vdbg(dma->dev, "%s(dma=%p)\n", __func__, dma);
>  
> @@ -192,7 +192,7 @@ int dma_send(struct dma *dma, dma_addr_t src, size_t len, void *metadata)
>  
>  int dma_get_cfg(struct dma *dma, u32 cfg_id, void **cfg_data)
>  {
> -	const struct dma_ops *ops = dma->dmad->ops;
> +	const struct dma_device_ops *ops = dma->dmad->ops;
>  
>  	dev_dbg(dma->dev, "%s(dma=%p)\n", __func__, dma);
>  
> diff --git a/drivers/dma/ti/k3-udma-am62l.c b/drivers/dma/ti/k3-udma-am62l.c
> index cd4a4cdf032f..ba54ba53e6d4 100644
> --- a/drivers/dma/ti/k3-udma-am62l.c
> +++ b/drivers/dma/ti/k3-udma-am62l.c
> @@ -408,7 +408,7 @@ static int am62l_udma_rfree(struct dma *dma)
>  	return 0;
>  }
>  
> -static const struct dma_ops am62l_udma_ops = {
> +static const struct dma_device_ops am62l_udma_ops = {
>  	.transfer	= udma_transfer,
>  	.of_xlate	= udma_of_xlate,
>  	.request	= am62l_udma_request,
> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> index fb0fe62c53a9..1f0594749549 100644
> --- a/drivers/dma/ti/k3-udma.c
> +++ b/drivers/dma/ti/k3-udma.c
> @@ -1190,7 +1190,7 @@ static int udma_rfree(struct dma *dma)
>  	return 0;
>  }
>  
> -static const struct dma_ops udma_ops = {
> +static const struct dma_device_ops udma_ops = {
>  	.transfer	= udma_transfer,
>  	.of_xlate	= udma_of_xlate,
>  	.request	= udma_request,
> diff --git a/include/dma-devices.h b/include/dma-devices.h
> index bbb25770f86b..bb081311dd72 100644
> --- a/include/dma-devices.h
> +++ b/include/dma-devices.h
> @@ -40,7 +40,7 @@ struct of_phandle_args;
>   * The uclass interface is implemented by all DMA devices which use
>   * driver model.
>   */
> -struct dma_ops {
> +struct dma_device_ops {
>  	/**
>  	 * of_xlate - Translate a client's device-tree (OF) DMA specifier.
>  	 *
> @@ -155,7 +155,7 @@ struct dma_ops {
>  
>  struct dma_device {
>  	struct device *dev;
> -	const struct dma_ops *ops;
> +	const struct dma_device_ops *ops;
>  	struct list_head list;
>  };
>  

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list