linux/drivers/infiniband/hw/mthca
Christophe JAILLET 3f69f4e0d6 RDMA: switch from 'pci_' to 'dma_' API
The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below.

It has been hand modified to use 'dma_set_mask_and_coherent()' instead of
'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable.
This is less verbose.

It has been compile tested.

@@
@@
-    PCI_DMA_BIDIRECTIONAL
+    DMA_BIDIRECTIONAL

@@
@@
-    PCI_DMA_TODEVICE
+    DMA_TO_DEVICE

@@
@@
-    PCI_DMA_FROMDEVICE
+    DMA_FROM_DEVICE

@@
@@
-    PCI_DMA_NONE
+    DMA_NONE

@@
expression e1, e2, e3;
@@
-    pci_alloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-    pci_zalloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-    pci_free_consistent(e1, e2, e3, e4)
+    dma_free_coherent(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_single(e1, e2, e3, e4)
+    dma_map_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_single(e1, e2, e3, e4)
+    dma_unmap_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-    pci_map_page(e1, e2, e3, e4, e5)
+    dma_map_page(&e1->dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_page(e1, e2, e3, e4)
+    dma_unmap_page(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_sg(e1, e2, e3, e4)
+    dma_map_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_sg(e1, e2, e3, e4)
+    dma_unmap_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_device(e1, e2, e3, e4)
+    dma_sync_single_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2;
@@
-    pci_dma_mapping_error(e1, e2)
+    dma_mapping_error(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_dma_mask(e1, e2)
+    dma_set_mask(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_consistent_dma_mask(e1, e2)
+    dma_set_coherent_mask(&e1->dev, e2)

Link: https://lore.kernel.org/r/259e53b7a00f64bf081d41da8761b171b2ad8f5c.1629634798.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-08-23 13:43:54 -03:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mthca_allocator.c IB: Remove unneeded memset 2019-07-03 14:26:49 -03:00
mthca_av.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mthca_catas.c treewide: setup_timer() -> timer_setup() (2 field) 2017-11-21 15:57:09 -08:00
mthca_cmd.c drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
mthca_cmd.h
mthca_config_reg.h
mthca_cq.c Linux 5.10-rc6 2020-12-01 20:40:50 -04:00
mthca_dev.h RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mthca_doorbell.h
mthca_eq.c RDMA: switch from 'pci_' to 'dma_' API 2021-08-23 13:43:54 -03:00
mthca_mad.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mthca_main.c RDMA: switch from 'pci_' to 'dma_' API 2021-08-23 13:43:54 -03:00
mthca_mcg.c
mthca_memfree.c RDMA: switch from 'pci_' to 'dma_' API 2021-08-23 13:43:54 -03:00
mthca_memfree.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
mthca_mr.c RDMA/mthca: Remove FMR support for memory registration 2020-06-02 20:32:54 -03:00
mthca_pd.c
mthca_profile.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
mthca_profile.h
mthca_provider.c RDMA: Globally allocate and release QP memory 2021-08-03 13:44:27 -03:00
mthca_provider.h RDMA/mthca: Combine special QP struct with mthca QP 2020-09-29 13:11:07 -03:00
mthca_qp.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mthca_reset.c IB/mthca: Remove debug prints after allocation failure 2016-12-03 13:12:52 -05:00
mthca_srq.c drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
mthca_uar.c
mthca_wqe.h