1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

ddbridge/main: Remove pci_set_dma_mask

Starting with Linux 5.18 `pci_set_dma_mask` has been removed. This patch
mimics commit 887069f42455 (media: switch from 'pci_' to 'dma_' API, Sun
Aug 22 11:30:08 2021 +0200) from upstream and thus prevents the
following compilation error.

ddbridge/ddbridge-main.c: In function ‘ddb_probe’:
ddbridge/ddbridge-main.c:286:14: error: implicit declaration of function ‘pci_set_dma_mask’; did you mean ‘ipi_send_mask’? [-Werror=implicit-function-declaration]
  286 |         if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
      |              ^~~~~~~~~~~~~~~~
      |              ipi_send_mask
ddbridge/ddbridge-main.c:287:17: error: implicit declaration of function ‘pci_set_consistent_dma_mask’ [-Werror=implicit-function-declaration]
  287 |                 pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
This commit is contained in:
Olliver Schinagl 2022-06-06 15:34:39 +02:00
parent c58d495688
commit 6fbed4920a
No known key found for this signature in database
GPG Key ID: 96E1A3A6C9044763

View File

@ -283,11 +283,17 @@ static int __devinit ddb_probe(struct pci_dev *pdev,
pci_set_master(pdev);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0))
if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
} else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
} else return -ENODEV;
} else
#else
if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)))
if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)))
#endif
return -ENODEV;
dev = vzalloc(sizeof(*dev));
if (!dev)