[PATCH] dmaengine: mmp_pdma: Add missing check for dma_set_mask

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add check for dma_set_mask() and return the error if it fails.

Fixes: c8acd6aa6bed ("dmaengine: mmp-pdma support")
Signed-off-by: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
---
 drivers/dma/mmp_pdma.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
index ebdfdcbb4f7a..9bf1625b065d 100644
--- a/drivers/dma/mmp_pdma.c
+++ b/drivers/dma/mmp_pdma.c
@@ -1103,9 +1103,11 @@ static int mmp_pdma_probe(struct platform_device *op)
 	pdev->device.residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR;
 
 	if (pdev->dev->coherent_dma_mask)
-		dma_set_mask(pdev->dev, pdev->dev->coherent_dma_mask);
+		ret = dma_set_mask(pdev->dev, pdev->dev->coherent_dma_mask);
 	else
-		dma_set_mask(pdev->dev, DMA_BIT_MASK(64));
+		ret = dma_set_mask(pdev->dev, DMA_BIT_MASK(64));
+	if (ret)
+		return ret;
 
 	ret = dma_async_device_register(&pdev->device);
 	if (ret) {
-- 
2.25.1




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux