[PATCH] mfd: omap-usb-host: Handle dma_set_coherent_mask error codes

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

 



The return value of dma_set_coherent_mask() is not always 0.
To catch the exception in case that dma is not support the mask.

Fixes: cbb8c220e70d ("mfd: Remove omap-usb-host magic numbers for dev dma mask")
Signed-off-by: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
---
 drivers/mfd/omap-usb-host.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 2a3a240b4619..05af9ad314b1 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -169,7 +169,11 @@ static struct platform_device *omap_usbhs_alloc_child(const char *name,
 	}
 
 	child->dev.dma_mask		= &usbhs_dmamask;
-	dma_set_coherent_mask(&child->dev, DMA_BIT_MASK(32));
+	ret = dma_set_coherent_mask(&child->dev, DMA_BIT_MASK(32));
+	if (ret) {
+		dev_err(&child->dev, "DMA enable failed\n");
+		goto err_alloc;
+	}
 	child->dev.parent		= dev;
 
 	ret = platform_device_add(child);
-- 
2.25.1




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux