diff mbox series

[1/1] dmaengine: xilinx_dma: Set dma_device.directions

Message ID D8EI6SI5EIUY.2JD240P96ZZSS@folker-schwesinger.de (mailing list archive)
State New
Headers show
Series dmaengine: xilinx_dma: Set dma_device.directions | expand

Commit Message

Folker Schwesinger March 12, 2025, 6:23 p.m. UTC
When using the dma_get_slave_caps() API, it checks the directions fields of
the dma_device structure. Currently, the Xilinx DMA driver does not set
this, which causes dma_get_slave_caps() to return -ENXIO.

Fix this issue by setting the directions field of the dma_device
structure during DMA channel probe.

Signed-off-by: Folker Schwesinger <dev@folker-schwesinger.de>
---
 drivers/dma/xilinx/xilinx_dma.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 3ad44afd0e74..63c308f2ae81 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -2864,6 +2864,7 @@  static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
 	    of_device_is_compatible(node, "xlnx,axi-dma-mm2s-channel") ||
 	    of_device_is_compatible(node, "xlnx,axi-cdma-channel")) {
 		chan->direction = DMA_MEM_TO_DEV;
+		xdev->common.directions |= BIT(DMA_MEM_TO_DEV);
 		chan->id = xdev->mm2s_chan_id++;
 		chan->tdest = chan->id;
 
@@ -2881,6 +2882,7 @@  static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
 		   of_device_is_compatible(node,
 					   "xlnx,axi-dma-s2mm-channel")) {
 		chan->direction = DMA_DEV_TO_MEM;
+		xdev->common.directions |= BIT(DMA_DEV_TO_MEM);
 		chan->id = xdev->s2mm_chan_id++;
 		chan->tdest = chan->id - xdev->dma_config->max_channels / 2;
 		chan->has_vflip = of_property_read_bool(node,