diff -Nurp build.old/mst_pciconf.c build/mst_pciconf.c --- build.old/mst_pciconf.c 2022-06-05 00:39:37.000000000 +0200 +++ build/mst_pciconf.c 2022-06-05 00:57:29.857473193 +0200 @@ -598,7 +598,11 @@ static void close_dma(struct dev_data* d int i = 0; for (i = 0; i < MST_DMA_END; i++) { if (dev->dma_props[i].mem_pa) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) pci_unmap_single(dev->pci_dev, dev->dma_props[i].dma_map, DMA_MBOX_SIZE, DMA_BIDIRECTIONAL); +#else + dma_unmap_single(&dev->pci_dev->dev, dev->dma_props[i].dma_map, DMA_MBOX_SIZE, DMA_BIDIRECTIONAL); +#endif kfree(dev->dma_props[i].mem_pa); dev->dma_props[i].mem_pa = NULL; }