Commit 7f683b92 authored by Christoph Hellwig's avatar Christoph Hellwig

i825xx: switch to switch to dma_alloc_attrs

This way we can always pass DMA_ATTR_NON_CONSISTENT, the SNI mips version
will simply ignore the flag.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ae9f608f
...@@ -96,8 +96,6 @@ ...@@ -96,8 +96,6 @@
#define OPT_SWAP_PORT 0x0001 /* Need to wordswp on the MPU port */ #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) \ #define DMA_WBACK(ndev, addr, len) \
do { dma_cache_sync((ndev)->dev.parent, (void *)addr, len, DMA_TO_DEVICE); } while (0) 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) ...@@ -200,8 +198,8 @@ static int lan_remove_chip(struct parisc_device *pdev)
struct i596_private *lp = netdev_priv(dev); struct i596_private *lp = netdev_priv(dev);
unregister_netdev (dev); unregister_netdev (dev);
DMA_FREE(&pdev->dev, sizeof(struct i596_private), dma_free_attrs(&pdev->dev, sizeof(struct i596_private), lp->dma,
(void *)lp->dma, lp->dma_addr); lp->dma_addr, DMA_ATTR_NON_CONSISTENT);
free_netdev (dev); free_netdev (dev);
return 0; return 0;
} }
......
...@@ -1063,8 +1063,9 @@ static int i82596_probe(struct net_device *dev) ...@@ -1063,8 +1063,9 @@ static int i82596_probe(struct net_device *dev)
if (!dev->base_addr || !dev->irq) if (!dev->base_addr || !dev->irq)
return -ENODEV; return -ENODEV;
dma = (struct i596_dma *) DMA_ALLOC(dev->dev.parent, dma = dma_alloc_attrs(dev->dev.parent, sizeof(struct i596_dma),
sizeof(struct i596_dma), &lp->dma_addr, GFP_KERNEL); &lp->dma_addr, GFP_KERNEL,
DMA_ATTR_NON_CONSISTENT);
if (!dma) { if (!dma) {
printk(KERN_ERR "%s: Couldn't get shared memory\n", __FILE__); printk(KERN_ERR "%s: Couldn't get shared memory\n", __FILE__);
return -ENOMEM; return -ENOMEM;
...@@ -1085,8 +1086,8 @@ static int i82596_probe(struct net_device *dev) ...@@ -1085,8 +1086,8 @@ static int i82596_probe(struct net_device *dev)
i = register_netdev(dev); i = register_netdev(dev);
if (i) { if (i) {
DMA_FREE(dev->dev.parent, sizeof(struct i596_dma), dma_free_attrs(dev->dev.parent, sizeof(struct i596_dma),
(void *)dma, lp->dma_addr); dma, lp->dma_addr, DMA_ATTR_NON_CONSISTENT);
return i; return i;
} }
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
static const char sni_82596_string[] = "snirm_82596"; 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_WBACK(priv, addr, len) do { } while (0)
#define DMA_INV(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) #define DMA_WBACK_INV(priv, addr, len) do { } while (0)
...@@ -152,8 +150,8 @@ static int sni_82596_driver_remove(struct platform_device *pdev) ...@@ -152,8 +150,8 @@ static int sni_82596_driver_remove(struct platform_device *pdev)
struct i596_private *lp = netdev_priv(dev); struct i596_private *lp = netdev_priv(dev);
unregister_netdev(dev); unregister_netdev(dev);
DMA_FREE(dev->dev.parent, sizeof(struct i596_private), dma_free_attrs(dev->dev.parent, sizeof(struct i596_private), lp->dma,
lp->dma, lp->dma_addr); lp->dma_addr, DMA_ATTR_NON_CONSISTENT);
iounmap(lp->ca); iounmap(lp->ca);
iounmap(lp->mpu_port); iounmap(lp->mpu_port);
free_netdev (dev); free_netdev (dev);
......
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