diff options
author | Christoph Hellwig <hch@lst.de> | 2018-10-10 12:40:56 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-10-17 21:58:52 -0400 |
commit | 7f9b0f774fdf26a5d76363d889ba587e242a497b (patch) | |
tree | 7510a230c48daa0bfe2e4d72dba2f13b5f6f8ec8 | |
parent | c22b332d811b90448e090c7fb487448afb039fcc (diff) |
scsi: fnic: switch to generic DMA API
Switch from the legacy PCI DMA API to the generic DMA API.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/fnic/fnic_fcs.c | 41 | ||||
-rw-r--r-- | drivers/scsi/fnic/fnic_main.c | 19 | ||||
-rw-r--r-- | drivers/scsi/fnic/fnic_scsi.c | 38 | ||||
-rw-r--r-- | drivers/scsi/fnic/vnic_dev.c | 26 |
4 files changed, 49 insertions, 75 deletions
diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c index c7bf316d8e83..844ef688fa91 100644 --- a/drivers/scsi/fnic/fnic_fcs.c +++ b/drivers/scsi/fnic/fnic_fcs.c | |||
@@ -836,8 +836,8 @@ static void fnic_rq_cmpl_frame_recv(struct vnic_rq *rq, struct cq_desc | |||
836 | u32 fcp_bytes_written = 0; | 836 | u32 fcp_bytes_written = 0; |
837 | unsigned long flags; | 837 | unsigned long flags; |
838 | 838 | ||
839 | pci_unmap_single(fnic->pdev, buf->dma_addr, buf->len, | 839 | dma_unmap_single(&fnic->pdev->dev, buf->dma_addr, buf->len, |
840 | PCI_DMA_FROMDEVICE); | 840 | DMA_FROM_DEVICE); |
841 | skb = buf->os_buf; | 841 | skb = buf->os_buf; |
842 | fp = (struct fc_frame *)skb; | 842 | fp = (struct fc_frame *)skb; |
843 | buf->os_buf = NULL; | 843 | buf->os_buf = NULL; |
@@ -977,9 +977,8 @@ int fnic_alloc_rq_frame(struct vnic_rq *rq) | |||
977 | skb_reset_transport_header(skb); | 977 | skb_reset_transport_header(skb); |
978 | skb_reset_network_header(skb); | 978 | skb_reset_network_header(skb); |
979 | skb_put(skb, len); | 979 | skb_put(skb, len); |
980 | pa = pci_map_single(fnic->pdev, skb->data, len, PCI_DMA_FROMDEVICE); | 980 | pa = dma_map_single(&fnic->pdev->dev, skb->data, len, DMA_FROM_DEVICE); |
981 | 981 | if (dma_mapping_error(&fnic->pdev->dev, pa)) { | |
982 | if (pci_dma_mapping_error(fnic->pdev, pa)) { | ||
983 | r = -ENOMEM; | 982 | r = -ENOMEM; |
984 | printk(KERN_ERR "PCI mapping failed with error %d\n", r); | 983 | printk(KERN_ERR "PCI mapping failed with error %d\n", r); |
985 | goto free_skb; | 984 | goto free_skb; |
@@ -998,8 +997,8 @@ void fnic_free_rq_buf(struct vnic_rq *rq, struct vnic_rq_buf *buf) | |||
998 | struct fc_frame *fp = buf->os_buf; | 997 | struct fc_frame *fp = buf->os_buf; |
999 | struct fnic *fnic = vnic_dev_priv(rq->vdev); | 998 | struct fnic *fnic = vnic_dev_priv(rq->vdev); |
1000 | 999 | ||
1001 | pci_unmap_single(fnic->pdev, buf->dma_addr, buf->len, | 1000 | dma_unmap_single(&fnic->pdev->dev, buf->dma_addr, buf->len, |
1002 | PCI_DMA_FROMDEVICE); | 1001 | DMA_FROM_DEVICE); |
1003 | 1002 | ||
1004 | dev_kfree_skb(fp_skb(fp)); | 1003 | dev_kfree_skb(fp_skb(fp)); |
1005 | buf->os_buf = NULL; | 1004 | buf->os_buf = NULL; |
@@ -1018,7 +1017,6 @@ void fnic_eth_send(struct fcoe_ctlr *fip, struct sk_buff *skb) | |||
1018 | struct ethhdr *eth_hdr; | 1017 | struct ethhdr *eth_hdr; |
1019 | struct vlan_ethhdr *vlan_hdr; | 1018 | struct vlan_ethhdr *vlan_hdr; |
1020 | unsigned long flags; | 1019 | unsigned long flags; |
1021 | int r; | ||
1022 | 1020 | ||
1023 | if (!fnic->vlan_hw_insert) { | 1021 | if (!fnic->vlan_hw_insert) { |
1024 | eth_hdr = (struct ethhdr *)skb_mac_header(skb); | 1022 | eth_hdr = (struct ethhdr *)skb_mac_header(skb); |
@@ -1038,11 +1036,10 @@ void fnic_eth_send(struct fcoe_ctlr *fip, struct sk_buff *skb) | |||
1038 | } | 1036 | } |
1039 | } | 1037 | } |
1040 | 1038 | ||
1041 | pa = pci_map_single(fnic->pdev, skb->data, skb->len, PCI_DMA_TODEVICE); | 1039 | pa = dma_map_single(&fnic->pdev->dev, skb->data, skb->len, |
1042 | 1040 | DMA_TO_DEVICE); | |
1043 | r = pci_dma_mapping_error(fnic->pdev, pa); | 1041 | if (dma_mapping_error(&fnic->pdev->dev, pa)) { |
1044 | if (r) { | 1042 | printk(KERN_ERR "DMA mapping failed\n"); |
1045 | printk(KERN_ERR "PCI mapping failed with error %d\n", r); | ||
1046 | goto free_skb; | 1043 | goto free_skb; |
1047 | } | 1044 | } |
1048 | 1045 | ||
@@ -1058,7 +1055,7 @@ void fnic_eth_send(struct fcoe_ctlr *fip, struct sk_buff *skb) | |||
1058 | 1055 | ||
1059 | irq_restore: | 1056 | irq_restore: |
1060 | spin_unlock_irqrestore(&fnic->wq_lock[0], flags); | 1057 | spin_unlock_irqrestore(&fnic->wq_lock[0], flags); |
1061 | pci_unmap_single(fnic->pdev, pa, skb->len, PCI_DMA_TODEVICE); | 1058 | dma_unmap_single(&fnic->pdev->dev, pa, skb->len, DMA_TO_DEVICE); |
1062 | free_skb: | 1059 | free_skb: |
1063 | kfree_skb(skb); | 1060 | kfree_skb(skb); |
1064 | } | 1061 | } |
@@ -1115,9 +1112,8 @@ static int fnic_send_frame(struct fnic *fnic, struct fc_frame *fp) | |||
1115 | if (FC_FCOE_VER) | 1112 | if (FC_FCOE_VER) |
1116 | FC_FCOE_ENCAPS_VER(fcoe_hdr, FC_FCOE_VER); | 1113 | FC_FCOE_ENCAPS_VER(fcoe_hdr, FC_FCOE_VER); |
1117 | 1114 | ||
1118 | pa = pci_map_single(fnic->pdev, eth_hdr, tot_len, PCI_DMA_TODEVICE); | 1115 | pa = dma_map_single(&fnic->pdev->dev, eth_hdr, tot_len, DMA_TO_DEVICE); |
1119 | 1116 | if (dma_mapping_error(&fnic->pdev->dev, pa)) { | |
1120 | if (pci_dma_mapping_error(fnic->pdev, pa)) { | ||
1121 | ret = -ENOMEM; | 1117 | ret = -ENOMEM; |
1122 | printk(KERN_ERR "DMA map failed with error %d\n", ret); | 1118 | printk(KERN_ERR "DMA map failed with error %d\n", ret); |
1123 | goto free_skb_on_err; | 1119 | goto free_skb_on_err; |
@@ -1131,8 +1127,7 @@ static int fnic_send_frame(struct fnic *fnic, struct fc_frame *fp) | |||
1131 | spin_lock_irqsave(&fnic->wq_lock[0], flags); | 1127 | spin_lock_irqsave(&fnic->wq_lock[0], flags); |
1132 | 1128 | ||
1133 | if (!vnic_wq_desc_avail(wq)) { | 1129 | if (!vnic_wq_desc_avail(wq)) { |
1134 | pci_unmap_single(fnic->pdev, pa, | 1130 | dma_unmap_single(&fnic->pdev->dev, pa, tot_len, DMA_TO_DEVICE); |
1135 | tot_len, PCI_DMA_TODEVICE); | ||
1136 | ret = -1; | 1131 | ret = -1; |
1137 | goto irq_restore; | 1132 | goto irq_restore; |
1138 | } | 1133 | } |
@@ -1247,8 +1242,8 @@ static void fnic_wq_complete_frame_send(struct vnic_wq *wq, | |||
1247 | struct fc_frame *fp = (struct fc_frame *)skb; | 1242 | struct fc_frame *fp = (struct fc_frame *)skb; |
1248 | struct fnic *fnic = vnic_dev_priv(wq->vdev); | 1243 | struct fnic *fnic = vnic_dev_priv(wq->vdev); |
1249 | 1244 | ||
1250 | pci_unmap_single(fnic->pdev, buf->dma_addr, | 1245 | dma_unmap_single(&fnic->pdev->dev, buf->dma_addr, buf->len, |
1251 | buf->len, PCI_DMA_TODEVICE); | 1246 | DMA_TO_DEVICE); |
1252 | dev_kfree_skb_irq(fp_skb(fp)); | 1247 | dev_kfree_skb_irq(fp_skb(fp)); |
1253 | buf->os_buf = NULL; | 1248 | buf->os_buf = NULL; |
1254 | } | 1249 | } |
@@ -1290,8 +1285,8 @@ void fnic_free_wq_buf(struct vnic_wq *wq, struct vnic_wq_buf *buf) | |||
1290 | struct fc_frame *fp = buf->os_buf; | 1285 | struct fc_frame *fp = buf->os_buf; |
1291 | struct fnic *fnic = vnic_dev_priv(wq->vdev); | 1286 | struct fnic *fnic = vnic_dev_priv(wq->vdev); |
1292 | 1287 | ||
1293 | pci_unmap_single(fnic->pdev, buf->dma_addr, | 1288 | dma_unmap_single(&fnic->pdev->dev, buf->dma_addr, buf->len, |
1294 | buf->len, PCI_DMA_TODEVICE); | 1289 | DMA_TO_DEVICE); |
1295 | 1290 | ||
1296 | dev_kfree_skb(fp_skb(fp)); | 1291 | dev_kfree_skb(fp_skb(fp)); |
1297 | buf->os_buf = NULL; | 1292 | buf->os_buf = NULL; |
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index e52599f44170..cc461fd7bef1 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c | |||
@@ -611,30 +611,15 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
611 | * limitation for the device. Try 64-bit first, and | 611 | * limitation for the device. Try 64-bit first, and |
612 | * fail to 32-bit. | 612 | * fail to 32-bit. |
613 | */ | 613 | */ |
614 | err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64)); | 614 | err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); |
615 | if (err) { | 615 | if (err) { |
616 | err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); | 616 | err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
617 | if (err) { | 617 | if (err) { |
618 | shost_printk(KERN_ERR, fnic->lport->host, | 618 | shost_printk(KERN_ERR, fnic->lport->host, |
619 | "No usable DMA configuration " | 619 | "No usable DMA configuration " |
620 | "aborting\n"); | 620 | "aborting\n"); |
621 | goto err_out_release_regions; | 621 | goto err_out_release_regions; |
622 | } | 622 | } |
623 | err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); | ||
624 | if (err) { | ||
625 | shost_printk(KERN_ERR, fnic->lport->host, | ||
626 | "Unable to obtain 32-bit DMA " | ||
627 | "for consistent allocations, aborting.\n"); | ||
628 | goto err_out_release_regions; | ||
629 | } | ||
630 | } else { | ||
631 | err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); | ||
632 | if (err) { | ||
633 | shost_printk(KERN_ERR, fnic->lport->host, | ||
634 | "Unable to obtain 64-bit DMA " | ||
635 | "for consistent allocations, aborting.\n"); | ||
636 | goto err_out_release_regions; | ||
637 | } | ||
638 | } | 623 | } |
639 | 624 | ||
640 | /* Map vNIC resources from BAR0 */ | 625 | /* Map vNIC resources from BAR0 */ |
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 8cbd3c9f0b4c..12a2f8fa4d19 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c | |||
@@ -126,17 +126,17 @@ static void fnic_release_ioreq_buf(struct fnic *fnic, | |||
126 | struct scsi_cmnd *sc) | 126 | struct scsi_cmnd *sc) |
127 | { | 127 | { |
128 | if (io_req->sgl_list_pa) | 128 | if (io_req->sgl_list_pa) |
129 | pci_unmap_single(fnic->pdev, io_req->sgl_list_pa, | 129 | dma_unmap_single(&fnic->pdev->dev, io_req->sgl_list_pa, |
130 | sizeof(io_req->sgl_list[0]) * io_req->sgl_cnt, | 130 | sizeof(io_req->sgl_list[0]) * io_req->sgl_cnt, |
131 | PCI_DMA_TODEVICE); | 131 | DMA_TO_DEVICE); |
132 | scsi_dma_unmap(sc); | 132 | scsi_dma_unmap(sc); |
133 | 133 | ||
134 | if (io_req->sgl_cnt) | 134 | if (io_req->sgl_cnt) |
135 | mempool_free(io_req->sgl_list_alloc, | 135 | mempool_free(io_req->sgl_list_alloc, |
136 | fnic->io_sgl_pool[io_req->sgl_type]); | 136 | fnic->io_sgl_pool[io_req->sgl_type]); |
137 | if (io_req->sense_buf_pa) | 137 | if (io_req->sense_buf_pa) |
138 | pci_unmap_single(fnic->pdev, io_req->sense_buf_pa, | 138 | dma_unmap_single(&fnic->pdev->dev, io_req->sense_buf_pa, |
139 | SCSI_SENSE_BUFFERSIZE, PCI_DMA_FROMDEVICE); | 139 | SCSI_SENSE_BUFFERSIZE, DMA_FROM_DEVICE); |
140 | } | 140 | } |
141 | 141 | ||
142 | /* Free up Copy Wq descriptors. Called with copy_wq lock held */ | 142 | /* Free up Copy Wq descriptors. Called with copy_wq lock held */ |
@@ -330,7 +330,6 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic, | |||
330 | int flags; | 330 | int flags; |
331 | u8 exch_flags; | 331 | u8 exch_flags; |
332 | struct scsi_lun fc_lun; | 332 | struct scsi_lun fc_lun; |
333 | int r; | ||
334 | 333 | ||
335 | if (sg_count) { | 334 | if (sg_count) { |
336 | /* For each SGE, create a device desc entry */ | 335 | /* For each SGE, create a device desc entry */ |
@@ -342,30 +341,25 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic, | |||
342 | desc++; | 341 | desc++; |
343 | } | 342 | } |
344 | 343 | ||
345 | io_req->sgl_list_pa = pci_map_single | 344 | io_req->sgl_list_pa = dma_map_single(&fnic->pdev->dev, |
346 | (fnic->pdev, | 345 | io_req->sgl_list, |
347 | io_req->sgl_list, | 346 | sizeof(io_req->sgl_list[0]) * sg_count, |
348 | sizeof(io_req->sgl_list[0]) * sg_count, | 347 | DMA_TO_DEVICE); |
349 | PCI_DMA_TODEVICE); | 348 | if (dma_mapping_error(&fnic->pdev->dev, io_req->sgl_list_pa)) { |
350 | 349 | printk(KERN_ERR "DMA mapping failed\n"); | |
351 | r = pci_dma_mapping_error(fnic->pdev, io_req->sgl_list_pa); | ||
352 | if (r) { | ||
353 | printk(KERN_ERR "PCI mapping failed with error %d\n", r); | ||
354 | return SCSI_MLQUEUE_HOST_BUSY; | 350 | return SCSI_MLQUEUE_HOST_BUSY; |
355 | } | 351 | } |
356 | } | 352 | } |
357 | 353 | ||
358 | io_req->sense_buf_pa = pci_map_single(fnic->pdev, | 354 | io_req->sense_buf_pa = dma_map_single(&fnic->pdev->dev, |
359 | sc->sense_buffer, | 355 | sc->sense_buffer, |
360 | SCSI_SENSE_BUFFERSIZE, | 356 | SCSI_SENSE_BUFFERSIZE, |
361 | PCI_DMA_FROMDEVICE); | 357 | DMA_FROM_DEVICE); |
362 | 358 | if (dma_mapping_error(&fnic->pdev->dev, io_req->sense_buf_pa)) { | |
363 | r = pci_dma_mapping_error(fnic->pdev, io_req->sense_buf_pa); | 359 | dma_unmap_single(&fnic->pdev->dev, io_req->sgl_list_pa, |
364 | if (r) { | ||
365 | pci_unmap_single(fnic->pdev, io_req->sgl_list_pa, | ||
366 | sizeof(io_req->sgl_list[0]) * sg_count, | 360 | sizeof(io_req->sgl_list[0]) * sg_count, |
367 | PCI_DMA_TODEVICE); | 361 | DMA_TO_DEVICE); |
368 | printk(KERN_ERR "PCI mapping failed with error %d\n", r); | 362 | printk(KERN_ERR "DMA mapping failed\n"); |
369 | return SCSI_MLQUEUE_HOST_BUSY; | 363 | return SCSI_MLQUEUE_HOST_BUSY; |
370 | } | 364 | } |
371 | 365 | ||
diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c index ba69d6112fa1..434447ea24b8 100644 --- a/drivers/scsi/fnic/vnic_dev.c +++ b/drivers/scsi/fnic/vnic_dev.c | |||
@@ -195,9 +195,9 @@ int vnic_dev_alloc_desc_ring(struct vnic_dev *vdev, struct vnic_dev_ring *ring, | |||
195 | { | 195 | { |
196 | vnic_dev_desc_ring_size(ring, desc_count, desc_size); | 196 | vnic_dev_desc_ring_size(ring, desc_count, desc_size); |
197 | 197 | ||
198 | ring->descs_unaligned = pci_alloc_consistent(vdev->pdev, | 198 | ring->descs_unaligned = dma_alloc_coherent(&vdev->pdev->dev, |
199 | ring->size_unaligned, | 199 | ring->size_unaligned, |
200 | &ring->base_addr_unaligned); | 200 | &ring->base_addr_unaligned, GFP_KERNEL); |
201 | 201 | ||
202 | if (!ring->descs_unaligned) { | 202 | if (!ring->descs_unaligned) { |
203 | printk(KERN_ERR | 203 | printk(KERN_ERR |
@@ -221,7 +221,7 @@ int vnic_dev_alloc_desc_ring(struct vnic_dev *vdev, struct vnic_dev_ring *ring, | |||
221 | void vnic_dev_free_desc_ring(struct vnic_dev *vdev, struct vnic_dev_ring *ring) | 221 | void vnic_dev_free_desc_ring(struct vnic_dev *vdev, struct vnic_dev_ring *ring) |
222 | { | 222 | { |
223 | if (ring->descs) { | 223 | if (ring->descs) { |
224 | pci_free_consistent(vdev->pdev, | 224 | dma_free_coherent(&vdev->pdev->dev, |
225 | ring->size_unaligned, | 225 | ring->size_unaligned, |
226 | ring->descs_unaligned, | 226 | ring->descs_unaligned, |
227 | ring->base_addr_unaligned); | 227 | ring->base_addr_unaligned); |
@@ -298,9 +298,9 @@ int vnic_dev_fw_info(struct vnic_dev *vdev, | |||
298 | int err = 0; | 298 | int err = 0; |
299 | 299 | ||
300 | if (!vdev->fw_info) { | 300 | if (!vdev->fw_info) { |
301 | vdev->fw_info = pci_alloc_consistent(vdev->pdev, | 301 | vdev->fw_info = dma_alloc_coherent(&vdev->pdev->dev, |
302 | sizeof(struct vnic_devcmd_fw_info), | 302 | sizeof(struct vnic_devcmd_fw_info), |
303 | &vdev->fw_info_pa); | 303 | &vdev->fw_info_pa, GFP_KERNEL); |
304 | if (!vdev->fw_info) | 304 | if (!vdev->fw_info) |
305 | return -ENOMEM; | 305 | return -ENOMEM; |
306 | 306 | ||
@@ -361,8 +361,8 @@ int vnic_dev_stats_dump(struct vnic_dev *vdev, struct vnic_stats **stats) | |||
361 | int wait = 1000; | 361 | int wait = 1000; |
362 | 362 | ||
363 | if (!vdev->stats) { | 363 | if (!vdev->stats) { |
364 | vdev->stats = pci_alloc_consistent(vdev->pdev, | 364 | vdev->stats = dma_alloc_coherent(&vdev->pdev->dev, |
365 | sizeof(struct vnic_stats), &vdev->stats_pa); | 365 | sizeof(struct vnic_stats), &vdev->stats_pa, GFP_KERNEL); |
366 | if (!vdev->stats) | 366 | if (!vdev->stats) |
367 | return -ENOMEM; | 367 | return -ENOMEM; |
368 | } | 368 | } |
@@ -523,9 +523,9 @@ int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr) | |||
523 | int wait = 1000; | 523 | int wait = 1000; |
524 | 524 | ||
525 | if (!vdev->notify) { | 525 | if (!vdev->notify) { |
526 | vdev->notify = pci_alloc_consistent(vdev->pdev, | 526 | vdev->notify = dma_alloc_coherent(&vdev->pdev->dev, |
527 | sizeof(struct vnic_devcmd_notify), | 527 | sizeof(struct vnic_devcmd_notify), |
528 | &vdev->notify_pa); | 528 | &vdev->notify_pa, GFP_KERNEL); |
529 | if (!vdev->notify) | 529 | if (!vdev->notify) |
530 | return -ENOMEM; | 530 | return -ENOMEM; |
531 | } | 531 | } |
@@ -647,21 +647,21 @@ void vnic_dev_unregister(struct vnic_dev *vdev) | |||
647 | { | 647 | { |
648 | if (vdev) { | 648 | if (vdev) { |
649 | if (vdev->notify) | 649 | if (vdev->notify) |
650 | pci_free_consistent(vdev->pdev, | 650 | dma_free_coherent(&vdev->pdev->dev, |
651 | sizeof(struct vnic_devcmd_notify), | 651 | sizeof(struct vnic_devcmd_notify), |
652 | vdev->notify, | 652 | vdev->notify, |
653 | vdev->notify_pa); | 653 | vdev->notify_pa); |
654 | if (vdev->linkstatus) | 654 | if (vdev->linkstatus) |
655 | pci_free_consistent(vdev->pdev, | 655 | dma_free_coherent(&vdev->pdev->dev, |
656 | sizeof(u32), | 656 | sizeof(u32), |
657 | vdev->linkstatus, | 657 | vdev->linkstatus, |
658 | vdev->linkstatus_pa); | 658 | vdev->linkstatus_pa); |
659 | if (vdev->stats) | 659 | if (vdev->stats) |
660 | pci_free_consistent(vdev->pdev, | 660 | dma_free_coherent(&vdev->pdev->dev, |
661 | sizeof(struct vnic_stats), | 661 | sizeof(struct vnic_stats), |
662 | vdev->stats, vdev->stats_pa); | 662 | vdev->stats, vdev->stats_pa); |
663 | if (vdev->fw_info) | 663 | if (vdev->fw_info) |
664 | pci_free_consistent(vdev->pdev, | 664 | dma_free_coherent(&vdev->pdev->dev, |
665 | sizeof(struct vnic_devcmd_fw_info), | 665 | sizeof(struct vnic_devcmd_fw_info), |
666 | vdev->fw_info, vdev->fw_info_pa); | 666 | vdev->fw_info, vdev->fw_info_pa); |
667 | kfree(vdev); | 667 | kfree(vdev); |