Commit cae05861 authored by Sriram Dash's avatar Sriram Dash Committed by Greg Kroah-Hartman
Browse files

drivers/usb/host: fsl: Set DMA_MASK of usb platform device



Set DMA_MASK of usb platform device properly.

Signed-off-by: default avatarSriram Dash <sriram.dash@freescale.com>
Signed-off-by: default avatarRamneek Mehresh <ramneek.mehresh@freescale.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0cdd49a1
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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)