From: Tzafrir Cohen Subject: Revert: Fix build against linux >= 5.18.0 Reverts the following patch: From 09adb59cfe2aff9fc1c18cafb44ae0faf811adca Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 24 Apr 2022 18:01:49 +0200 Subject: [PATCH] Fix build against linux >= 5.18.0 This fixes the build against kernels >= 5.18.0 which contain the following commit removing teh pci-dma-compat API: commit 7968778914e53788a01c2dee2692cab157de9ac0 Author: Christophe JAILLET Date: Wed Mar 9 20:50:39 2022 +0100 PCI: Remove the deprecated "pci-dma-compat.h" API Change-Id: Ie05e5f42a5eef2dd0377fdc2c22b4a731619e372 --- include/dahdi/kernel.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h index a7739ae..9b0cbb5 100644 --- a/include/dahdi/kernel.h +++ b/include/dahdi/kernel.h @@ -70,39 +70,6 @@ #define PDE_DATA(i) pde_data(i) #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) -#include -static inline void * -pci_alloc_consistent(struct pci_dev *hwdev, size_t size, - dma_addr_t *dma_handle) -{ - return dma_alloc_coherent(&hwdev->dev, size, dma_handle, GFP_ATOMIC); -} - -static inline void -pci_free_consistent(struct pci_dev *hwdev, size_t size, - void *vaddr, dma_addr_t dma_handle) -{ - dma_free_coherent(&hwdev->dev, size, vaddr, dma_handle); -} -static inline dma_addr_t -pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) -{ - return dma_map_single(&hwdev->dev, ptr, size, (enum dma_data_direction)direction); -} - -static inline void -pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, - size_t size, int direction) -{ - dma_unmap_single(&hwdev->dev, dma_addr, size, (enum dma_data_direction)direction); -} -static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) -{ - return dma_set_mask(&dev->dev, mask); -} -#endif - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) #define HAVE_NET_DEVICE_OPS #endif -- 2.39.2