Commit 3cd54a61 authored by Ran Wang's avatar Ran Wang Committed by Greg Kroah-Hartman

usb: host: fsl-mph-dr-of: check return of dma_set_mask()

fsl_usb2_device_register() should stop init if dma_set_mask() return
error.

Fixes: cae05861 ("drivers/usb/host: fsl: Set DMA_MASK of usb platform device")
Reviewed-by: default avatarPeter Chen <peter.chen@nxp.com>
Signed-off-by: default avatarRan Wang <ran.wang_1@nxp.com>
Link: https://lore.kernel.org/r/20201010060308.33693-1-ran.wang_1@nxp.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cbdc0f54
......@@ -94,10 +94,13 @@ static struct platform_device *fsl_usb2_device_register(
pdev->dev.coherent_dma_mask = ofdev->dev.coherent_dma_mask;
if (!pdev->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));
} else {
retval = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
if (retval)
goto error;
}
retval = platform_device_add_data(pdev, pdata, sizeof(*pdata));
if (retval)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment