[PATCH] dmaengine: dw-axi-dmac: Add check for dma_set_max_seg_size in dw_probe()
From: Ma Ke
Date: Wed Jun 26 2024 - 04:54:41 EST
As the possible failure of the dma_set_max_seg_size(), we should better
check the return value of the dma_set_max_seg_size().
Fixes: 78a90a1e489e ("dmaengine: dw-axi-dmac: Set constraint to the Max segment size")
Signed-off-by: Ma Ke <make24@xxxxxxxxxxx>
---
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index fffafa86d964..689667e10928 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -1579,7 +1579,10 @@ static int dw_probe(struct platform_device *pdev)
* Therefore, set constraint to 1024 * 4.
*/
dw->dma.dev->dma_parms = &dw->dma_parms;
- dma_set_max_seg_size(&pdev->dev, MAX_BLOCK_SIZE);
+ ret = dma_set_max_seg_size(&pdev->dev, MAX_BLOCK_SIZE);
+ if (ret)
+ return ret;
+
platform_set_drvdata(pdev, chip);
pm_runtime_enable(chip->dev);
--
2.25.1