mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] drivers: dma: refactor: rename dma_ops to dma_device_ops.
@ 2025-09-14 19:32 chalianis1
  2025-09-15  9:00 ` Sascha Hauer
  2025-09-15  9:02 ` Ahmad Fatoum
  0 siblings, 2 replies; 4+ messages in thread
From: chalianis1 @ 2025-09-14 19:32 UTC (permalink / raw)
  To: s.hauer; +Cc: barebox, Chali Anis

From: Chali Anis <chalianis1@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.

Signed-off-by: Chali Anis <chalianis1@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;
 };
 
-- 
2.34.1




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

end of thread, other threads:[~2025-09-16  6:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-14 19:32 [PATCH] drivers: dma: refactor: rename dma_ops to dma_device_ops chalianis1
2025-09-15  9:00 ` Sascha Hauer
2025-09-15  9:02 ` Ahmad Fatoum
2025-09-16  6:33   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox