[PATCH 05/14] dmaengine: dma350: Register the DMA controller to DT DMA helpers
Jisheng Zhang
jszhang at kernel.org
Sat Aug 23 08:40:00 PDT 2025
Register the DMA controller to DT DMA helpers so that we convert a DT
phandle to a dma_chan structure.
Signed-off-by: Jisheng Zhang <jszhang at kernel.org>
---
drivers/dma/arm-dma350.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/arm-dma350.c b/drivers/dma/arm-dma350.c
index 17af9bb2a18f..6a9f81f941b0 100644
--- a/drivers/dma/arm-dma350.c
+++ b/drivers/dma/arm-dma350.c
@@ -7,6 +7,7 @@
#include <linux/dma-mapping.h>
#include <linux/io.h>
#include <linux/of.h>
+#include <linux/of_dma.h>
#include <linux/module.h>
#include <linux/platform_device.h>
@@ -635,7 +636,7 @@ static int d350_probe(struct platform_device *pdev)
if (ret)
return dev_err_probe(dev, ret, "Failed to register DMA device\n");
- return 0;
+ return of_dma_controller_register(dev->of_node, of_dma_xlate_by_chan_id, &dmac->dma);
}
static void d350_remove(struct platform_device *pdev)
@@ -643,6 +644,7 @@ static void d350_remove(struct platform_device *pdev)
struct d350 *dmac = platform_get_drvdata(pdev);
dma_async_device_unregister(&dmac->dma);
+ of_dma_controller_free(pdev->dev.of_node);
}
static const struct of_device_id d350_of_match[] __maybe_unused = {
--
2.50.0
More information about the linux-arm-kernel
mailing list