i825xx: switch to switch to dma_alloc_attrs
authorChristoph Hellwig <hch@lst.de>
Wed, 14 Jun 2017 08:33:48 +0000 (10:33 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 29 Aug 2017 08:03:45 +0000 (10:03 +0200)
This way we can always pass DMA_ATTR_NON_CONSISTENT, the SNI mips version
will simply ignore the flag.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/i825xx/lasi_82596.c
drivers/net/ethernet/i825xx/lib82596.c
drivers/net/ethernet/i825xx/sni_82596.c

index d787fdd5db7be0e24626c4078f13a0c6994eb508..d5b5021aa7595cb9ecde61361815830a614c7f62 100644 (file)
@@ -96,8 +96,6 @@
 
 #define OPT_SWAP_PORT  0x0001  /* Need to wordswp on the MPU port */
 
-#define DMA_ALLOC                        dma_alloc_noncoherent
-#define DMA_FREE                         dma_free_noncoherent
 #define DMA_WBACK(ndev, addr, len) \
        do { dma_cache_sync((ndev)->dev.parent, (void *)addr, len, DMA_TO_DEVICE); } while (0)
 
@@ -200,8 +198,8 @@ static int lan_remove_chip(struct parisc_device *pdev)
        struct i596_private *lp = netdev_priv(dev);
 
        unregister_netdev (dev);
-       DMA_FREE(&pdev->dev, sizeof(struct i596_private),
-                (void *)lp->dma, lp->dma_addr);
+       dma_free_attrs(&pdev->dev, sizeof(struct i596_private), lp->dma,
+                      lp->dma_addr, DMA_ATTR_NON_CONSISTENT);
        free_netdev (dev);
        return 0;
 }
index 8449c58f01fd6571c101f6d76a360c77237565fe..f00a1dc2128cbcfcf590cb22bf88aa3796b6ab45 100644 (file)
@@ -1063,8 +1063,9 @@ static int i82596_probe(struct net_device *dev)
        if (!dev->base_addr || !dev->irq)
                return -ENODEV;
 
-       dma = (struct i596_dma *) DMA_ALLOC(dev->dev.parent,
-               sizeof(struct i596_dma), &lp->dma_addr, GFP_KERNEL);
+       dma = dma_alloc_attrs(dev->dev.parent, sizeof(struct i596_dma),
+                             &lp->dma_addr, GFP_KERNEL,
+                             DMA_ATTR_NON_CONSISTENT);
        if (!dma) {
                printk(KERN_ERR "%s: Couldn't get shared memory\n", __FILE__);
                return -ENOMEM;
@@ -1085,8 +1086,8 @@ static int i82596_probe(struct net_device *dev)
 
        i = register_netdev(dev);
        if (i) {
-               DMA_FREE(dev->dev.parent, sizeof(struct i596_dma),
-                                   (void *)dma, lp->dma_addr);
+               dma_free_attrs(dev->dev.parent, sizeof(struct i596_dma),
+                              dma, lp->dma_addr, DMA_ATTR_NON_CONSISTENT);
                return i;
        }
 
index 2af7f77345fbdfad8cac859bad6e9584a7716dd4..b2c04a789744fc770b798d79b96604910077dfd3 100644 (file)
@@ -23,8 +23,6 @@
 
 static const char sni_82596_string[] = "snirm_82596";
 
-#define DMA_ALLOC                      dma_alloc_coherent
-#define DMA_FREE                       dma_free_coherent
 #define DMA_WBACK(priv, addr, len)     do { } while (0)
 #define DMA_INV(priv, addr, len)       do { } while (0)
 #define DMA_WBACK_INV(priv, addr, len) do { } while (0)
@@ -152,8 +150,8 @@ static int sni_82596_driver_remove(struct platform_device *pdev)
        struct i596_private *lp = netdev_priv(dev);
 
        unregister_netdev(dev);
-       DMA_FREE(dev->dev.parent, sizeof(struct i596_private),
-                lp->dma, lp->dma_addr);
+       dma_free_attrs(dev->dev.parent, sizeof(struct i596_private), lp->dma,
+                      lp->dma_addr, DMA_ATTR_NON_CONSISTENT);
        iounmap(lp->ca);
        iounmap(lp->mpu_port);
        free_netdev (dev);