| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * sni_82596.c -- driver for intel 82596 ethernet controller, as |
|---|
| 3 | 4 | * used in older SNI RM machines |
|---|
| .. | .. |
|---|
| 22 | 23 | #define SNI_82596_DRIVER_VERSION "SNI RM 82596 driver - Revision: 0.01" |
|---|
| 23 | 24 | |
|---|
| 24 | 25 | static const char sni_82596_string[] = "snirm_82596"; |
|---|
| 25 | | - |
|---|
| 26 | | -#define LIB82596_DMA_ATTR 0 |
|---|
| 27 | | - |
|---|
| 28 | | -#define DMA_WBACK(priv, addr, len) do { } while (0) |
|---|
| 29 | | -#define DMA_INV(priv, addr, len) do { } while (0) |
|---|
| 30 | | -#define DMA_WBACK_INV(priv, addr, len) do { } while (0) |
|---|
| 31 | 26 | |
|---|
| 32 | 27 | #define SYSBUS 0x00004400 |
|---|
| 33 | 28 | |
|---|
| .. | .. |
|---|
| 90 | 85 | idprom = platform_get_resource(dev, IORESOURCE_MEM, 2); |
|---|
| 91 | 86 | if (!res || !ca || !options || !idprom) |
|---|
| 92 | 87 | return -ENODEV; |
|---|
| 93 | | - mpu_addr = ioremap_nocache(res->start, 4); |
|---|
| 88 | + mpu_addr = ioremap(res->start, 4); |
|---|
| 94 | 89 | if (!mpu_addr) |
|---|
| 95 | 90 | return -ENOMEM; |
|---|
| 96 | | - ca_addr = ioremap_nocache(ca->start, 4); |
|---|
| 91 | + ca_addr = ioremap(ca->start, 4); |
|---|
| 97 | 92 | if (!ca_addr) |
|---|
| 98 | 93 | goto probe_failed_free_mpu; |
|---|
| 99 | 94 | |
|---|
| .. | .. |
|---|
| 109 | 104 | netdevice->base_addr = res->start; |
|---|
| 110 | 105 | netdevice->irq = platform_get_irq(dev, 0); |
|---|
| 111 | 106 | |
|---|
| 112 | | - eth_addr = ioremap_nocache(idprom->start, 0x10); |
|---|
| 107 | + eth_addr = ioremap(idprom->start, 0x10); |
|---|
| 113 | 108 | if (!eth_addr) |
|---|
| 114 | 109 | goto probe_failed; |
|---|
| 115 | 110 | |
|---|
| .. | .. |
|---|
| 134 | 129 | lp->ca = ca_addr; |
|---|
| 135 | 130 | lp->mpu_port = mpu_addr; |
|---|
| 136 | 131 | |
|---|
| 137 | | - retval = i82596_probe(netdevice); |
|---|
| 138 | | - if (retval == 0) |
|---|
| 139 | | - return 0; |
|---|
| 132 | + lp->dma = dma_alloc_coherent(&dev->dev, sizeof(struct i596_dma), |
|---|
| 133 | + &lp->dma_addr, GFP_KERNEL); |
|---|
| 134 | + if (!lp->dma) |
|---|
| 135 | + goto probe_failed; |
|---|
| 140 | 136 | |
|---|
| 137 | + retval = i82596_probe(netdevice); |
|---|
| 138 | + if (retval) |
|---|
| 139 | + goto probe_failed_free_dma; |
|---|
| 140 | + return 0; |
|---|
| 141 | + |
|---|
| 142 | +probe_failed_free_dma: |
|---|
| 143 | + dma_free_coherent(&dev->dev, sizeof(struct i596_dma), lp->dma, |
|---|
| 144 | + lp->dma_addr); |
|---|
| 141 | 145 | probe_failed: |
|---|
| 142 | 146 | free_netdev(netdevice); |
|---|
| 143 | 147 | probe_failed_free_ca: |
|---|
| .. | .. |
|---|
| 153 | 157 | struct i596_private *lp = netdev_priv(dev); |
|---|
| 154 | 158 | |
|---|
| 155 | 159 | unregister_netdev(dev); |
|---|
| 156 | | - dma_free_attrs(dev->dev.parent, sizeof(struct i596_private), lp->dma, |
|---|
| 157 | | - lp->dma_addr, LIB82596_DMA_ATTR); |
|---|
| 160 | + dma_free_coherent(&pdev->dev, sizeof(struct i596_private), lp->dma, |
|---|
| 161 | + lp->dma_addr); |
|---|
| 158 | 162 | iounmap(lp->ca); |
|---|
| 159 | 163 | iounmap(lp->mpu_port); |
|---|
| 160 | 164 | free_netdev (dev); |
|---|