.. | .. |
---|
138 | 138 | |
---|
139 | 139 | trace(icom_port, "RET_PORT_MEM", 0); |
---|
140 | 140 | if (icom_port->recv_buf) { |
---|
141 | | - pci_free_consistent(dev, 4096, icom_port->recv_buf, |
---|
142 | | - icom_port->recv_buf_pci); |
---|
| 141 | + dma_free_coherent(&dev->dev, 4096, icom_port->recv_buf, |
---|
| 142 | + icom_port->recv_buf_pci); |
---|
143 | 143 | icom_port->recv_buf = NULL; |
---|
144 | 144 | } |
---|
145 | 145 | if (icom_port->xmit_buf) { |
---|
146 | | - pci_free_consistent(dev, 4096, icom_port->xmit_buf, |
---|
147 | | - icom_port->xmit_buf_pci); |
---|
| 146 | + dma_free_coherent(&dev->dev, 4096, icom_port->xmit_buf, |
---|
| 147 | + icom_port->xmit_buf_pci); |
---|
148 | 148 | icom_port->xmit_buf = NULL; |
---|
149 | 149 | } |
---|
150 | 150 | if (icom_port->statStg) { |
---|
151 | | - pci_free_consistent(dev, 4096, icom_port->statStg, |
---|
152 | | - icom_port->statStg_pci); |
---|
| 151 | + dma_free_coherent(&dev->dev, 4096, icom_port->statStg, |
---|
| 152 | + icom_port->statStg_pci); |
---|
153 | 153 | icom_port->statStg = NULL; |
---|
154 | 154 | } |
---|
155 | 155 | |
---|
156 | 156 | if (icom_port->xmitRestart) { |
---|
157 | | - pci_free_consistent(dev, 4096, icom_port->xmitRestart, |
---|
158 | | - icom_port->xmitRestart_pci); |
---|
| 157 | + dma_free_coherent(&dev->dev, 4096, icom_port->xmitRestart, |
---|
| 158 | + icom_port->xmitRestart_pci); |
---|
159 | 159 | icom_port->xmitRestart = NULL; |
---|
160 | 160 | } |
---|
161 | 161 | } |
---|
.. | .. |
---|
169 | 169 | struct pci_dev *dev = icom_port->adapter->pci_dev; |
---|
170 | 170 | |
---|
171 | 171 | icom_port->xmit_buf = |
---|
172 | | - pci_alloc_consistent(dev, 4096, &icom_port->xmit_buf_pci); |
---|
| 172 | + dma_alloc_coherent(&dev->dev, 4096, &icom_port->xmit_buf_pci, |
---|
| 173 | + GFP_KERNEL); |
---|
173 | 174 | if (!icom_port->xmit_buf) { |
---|
174 | 175 | dev_err(&dev->dev, "Can not allocate Transmit buffer\n"); |
---|
175 | 176 | return -ENOMEM; |
---|
.. | .. |
---|
179 | 180 | (unsigned long) icom_port->xmit_buf); |
---|
180 | 181 | |
---|
181 | 182 | icom_port->recv_buf = |
---|
182 | | - pci_alloc_consistent(dev, 4096, &icom_port->recv_buf_pci); |
---|
| 183 | + dma_alloc_coherent(&dev->dev, 4096, &icom_port->recv_buf_pci, |
---|
| 184 | + GFP_KERNEL); |
---|
183 | 185 | if (!icom_port->recv_buf) { |
---|
184 | 186 | dev_err(&dev->dev, "Can not allocate Receive buffer\n"); |
---|
185 | 187 | free_port_memory(icom_port); |
---|
.. | .. |
---|
189 | 191 | (unsigned long) icom_port->recv_buf); |
---|
190 | 192 | |
---|
191 | 193 | icom_port->statStg = |
---|
192 | | - pci_alloc_consistent(dev, 4096, &icom_port->statStg_pci); |
---|
| 194 | + dma_alloc_coherent(&dev->dev, 4096, &icom_port->statStg_pci, |
---|
| 195 | + GFP_KERNEL); |
---|
193 | 196 | if (!icom_port->statStg) { |
---|
194 | 197 | dev_err(&dev->dev, "Can not allocate Status buffer\n"); |
---|
195 | 198 | free_port_memory(icom_port); |
---|
.. | .. |
---|
199 | 202 | (unsigned long) icom_port->statStg); |
---|
200 | 203 | |
---|
201 | 204 | icom_port->xmitRestart = |
---|
202 | | - pci_alloc_consistent(dev, 4096, &icom_port->xmitRestart_pci); |
---|
| 205 | + dma_alloc_coherent(&dev->dev, 4096, &icom_port->xmitRestart_pci, |
---|
| 206 | + GFP_KERNEL); |
---|
203 | 207 | if (!icom_port->xmitRestart) { |
---|
204 | 208 | dev_err(&dev->dev, |
---|
205 | 209 | "Can not allocate xmit Restart buffer\n"); |
---|
206 | 210 | free_port_memory(icom_port); |
---|
207 | 211 | return -ENOMEM; |
---|
208 | 212 | } |
---|
209 | | - |
---|
210 | | - memset(icom_port->statStg, 0, 4096); |
---|
211 | 213 | |
---|
212 | 214 | /* FODs: Frame Out Descriptor Queue, this is a FIFO queue that |
---|
213 | 215 | indicates that frames are to be transmitted |
---|
.. | .. |
---|
416 | 418 | /*Set up data in icom DRAM to indicate where personality |
---|
417 | 419 | *code is located and its length. |
---|
418 | 420 | */ |
---|
419 | | - new_page = pci_alloc_consistent(dev, 4096, &temp_pci); |
---|
| 421 | + new_page = dma_alloc_coherent(&dev->dev, 4096, &temp_pci, GFP_KERNEL); |
---|
420 | 422 | |
---|
421 | 423 | if (!new_page) { |
---|
422 | 424 | dev_err(&dev->dev, "Can not allocate DMA buffer\n"); |
---|
.. | .. |
---|
496 | 498 | } |
---|
497 | 499 | |
---|
498 | 500 | if (new_page != NULL) |
---|
499 | | - pci_free_consistent(dev, 4096, new_page, temp_pci); |
---|
| 501 | + dma_free_coherent(&dev->dev, 4096, new_page, temp_pci); |
---|
500 | 502 | } |
---|
501 | 503 | |
---|
502 | 504 | static int startup(struct icom_port *icom_port) |
---|
.. | .. |
---|
1501 | 1503 | retval = pci_read_config_dword(dev, PCI_COMMAND, &command_reg); |
---|
1502 | 1504 | if (retval) { |
---|
1503 | 1505 | dev_err(&dev->dev, "PCI Config read FAILED\n"); |
---|
1504 | | - return retval; |
---|
| 1506 | + goto probe_exit0; |
---|
1505 | 1507 | } |
---|
1506 | 1508 | |
---|
1507 | 1509 | pci_write_config_dword(dev, PCI_COMMAND, |
---|