amd-xgbe: Use dma_set_mask_and_coherent to set DMA mask
authorLendacky, Thomas <Thomas.Lendacky@amd.com>
Tue, 5 Aug 2014 18:30:38 +0000 (13:30 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Aug 2014 23:47:02 +0000 (16:47 -0700)
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 <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/xgbe/xgbe-main.c

index ec977d36063f198affd5993437f3e415f4bbf1f9..8aa6a9353f7bc5b5b3cf7592bc42186a93ca0bce 100644 (file)
@@ -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;