From: Lendacky, Thomas Date: Tue, 5 Aug 2014 18:30:38 +0000 (-0500) Subject: amd-xgbe: Use dma_set_mask_and_coherent to set DMA mask X-Git-Tag: v4.9.8~5959^2~3^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3d0e78d2e733176c2b0d23e7a7d871c7a33c2d6;p=platform%2Fkernel%2Flinux-rpi3.git amd-xgbe: Use dma_set_mask_and_coherent to set DMA mask Use the dma_set_mask_and_coherent function to set the DMA mask rather than setting the DMA mask fields directly. This was originally done to work around a bug in the arm64 DMA support when RAM started above the 4GB boundary which has since been fixed. Signed-off-by: Tom Lendacky Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c index ec977d3..8aa6a93 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c @@ -303,8 +303,11 @@ static int xgbe_probe(struct platform_device *pdev) /* Set the DMA mask */ if (!dev->dma_mask) dev->dma_mask = &dev->coherent_dma_mask; - *(dev->dma_mask) = DMA_BIT_MASK(40); - dev->coherent_dma_mask = DMA_BIT_MASK(40); + ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(40)); + if (ret) { + dev_err(dev, "dma_set_mask_and_coherent failed\n"); + goto err_io; + } if (of_property_read_bool(dev->of_node, "dma-coherent")) { pdata->axdomain = XGBE_DMA_OS_AXDOMAIN;