mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers/usb : Set DMA_MASK of usb platform device
@ 2015-12-17 11:32 Sriram Dash
  0 siblings, 0 replies; only message in thread
From: Sriram Dash @ 2015-12-17 11:32 UTC (permalink / raw)
  To: linux-kernel, linux-usb
  Cc: stern, gregkh, ramneek.mehresh, rajesh.bhagat, Sriram Dash

Set DMA_MASK of usb platform device properly.

Signed-off-by: Sriram Dash <sriram.dash@freescale.com>
Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
---
 drivers/usb/host/fsl-mph-dr-of.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index 0c38265..1044b0f 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -17,6 +17,7 @@
 #include <linux/of_platform.h>
 #include <linux/clk.h>
 #include <linux/module.h>
+#include <linux/dma-mapping.h>
 
 struct fsl_usb2_dev_data {
 	char *dr_mode;		/* controller mode */
@@ -96,7 +97,11 @@ static struct platform_device *fsl_usb2_device_register(
 	pdev->dev.parent = &ofdev->dev;
 
 	pdev->dev.coherent_dma_mask = ofdev->dev.coherent_dma_mask;
-	*pdev->dev.dma_mask = *ofdev->dev.dma_mask;
+
+	if (!pdev->dev.dma_mask)
+		pdev->dev.dma_mask = &ofdev->dev.coherent_dma_mask;
+	else
+		dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
 
 	retval = platform_device_add_data(pdev, pdata, sizeof(*pdata));
 	if (retval)
-- 
2.1.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-17 11:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-17 11:32 [PATCH] drivers/usb : Set DMA_MASK of usb platform device Sriram Dash

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®