OpenCloudOS-Kernel/drivers/media/pci/solo6x10
Christophe JAILLET 0c5a71dc6b media: solo6x10: 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 and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated in 'snd_solo_pcm_open()' (solo6x10-g723.c)
GFP_KERNEL can be used because this flag is already used jew a few lines
above.

When memory is allocated in 'solo_enc_alloc()' (solo6x10-v4l2-enc.c)
GFP_KERNEL can be used because this flag is already used jew a few lines
above.

When memory is allocated in 'solo_enc_v4l2_init()' (solo6x10-v4l2-enc.c)
GFP_KERNEL can be used because calls 'solo_enc_alloc()' which already uses
this flag.

@@
@@
-    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)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03 08:55:05 +01:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
solo6x10-core.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
solo6x10-disp.c media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-eeprom.c media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-enc.c media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-g723.c media: solo6x10: switch from 'pci_' to 'dma_' API 2020-12-03 08:55:05 +01:00
solo6x10-gpio.c media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-i2c.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
solo6x10-jpeg.h media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-offsets.h media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-p2m.c media: solo6x10: switch from 'pci_' to 'dma_' API 2020-12-03 08:55:05 +01:00
solo6x10-regs.h media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-tw28.c media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-tw28.h media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-v4l2-enc.c media: solo6x10: switch from 'pci_' to 'dma_' API 2020-12-03 08:55:05 +01:00
solo6x10-v4l2.c media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10.h media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00