From: Aaro Koskinen Date: Tue, 4 Dec 2018 22:19:26 +0000 (+0200) Subject: staging: octeon-usb: use a helper function to set the DMA mask X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b5630e3019b6ddad12aafdbb7b44114690f0a679;p=openwrt%2Fstaging%2Fblogic.git staging: octeon-usb: use a helper function to set the DMA mask Use a helper function to set the DMA mask. Signed-off-by: Aaro Koskinen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c index 9c766f5b812f..14982b6472a0 100644 --- a/drivers/staging/octeon-usb/octeon-hcd.c +++ b/drivers/staging/octeon-usb/octeon-hcd.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -3606,8 +3607,9 @@ static int octeon_usb_probe(struct platform_device *pdev) * Set the DMA mask to 64bits so we get buffers already translated for * DMA. */ - dev->coherent_dma_mask = ~0; - dev->dma_mask = &dev->coherent_dma_mask; + i = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(64)); + if (i) + return i; /* * Only cn52XX and cn56XX have DWC_OTG USB hardware and the