From 871821d6a0be147313bb52570591ce3853b3d370 Mon Sep 17 00:00:00 2001 From: internal Date: Tue, 7 Jun 2022 16:12:19 +0200 Subject: [PATCH] pci_*_dma_mask no longer exists in 5.18 --- ddbridge/ddbridge-main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ddbridge/ddbridge-main.c b/ddbridge/ddbridge-main.c index 14f94e2..09bc6dc 100644 --- a/ddbridge/ddbridge-main.c +++ b/ddbridge/ddbridge-main.c @@ -283,11 +283,17 @@ static int __devinit ddb_probe(struct pci_dev *pdev, pci_set_master(pdev); +#if (KERNEL_VERSION(5, 18, 0) <= LINUX_VERSION_CODE) + if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) + if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) +#else 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 +#endif + return -ENODEV; dev = vzalloc(sizeof(*dev)); if (!dev)