@@ -121,18 +121,12 @@ void OSFlushCPUCacheRangeKM(PVRSRV_DEVICE_NODE *psDevNode,
IMG_CPU_PHYADDR sCPUPhysEnd)
{
struct device *dev = psDevNode->psDevConfig->pvOSDevice;
- struct dma_map_ops *dma_ops = get_dma_ops(dev);
PVR_UNREFERENCED_PARAMETER(pvVirtStart);
PVR_UNREFERENCED_PARAMETER(pvVirtEnd);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
- dma_ops->sync_single_for_device(dev, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_TO_DEVICE);
- dma_ops->sync_single_for_cpu(dev, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_FROM_DEVICE);
-#else
- dma_ops->sync_single_for_device(NULL, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_TO_DEVICE);
- dma_ops->sync_single_for_cpu(NULL, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_FROM_DEVICE);
-#endif
+ dma_sync_single_for_device(dev, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_TO_DEVICE);
+ dma_sync_single_for_cpu(dev, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_FROM_DEVICE);
}
void OSCleanCPUCacheRangeKM(PVRSRV_DEVICE_NODE *psDevNode,
@@ -142,16 +136,11 @@ void OSCleanCPUCacheRangeKM(PVRSRV_DEVICE_NODE *psDevNode,
IMG_CPU_PHYADDR sCPUPhysEnd)
{
struct device *dev = psDevNode->psDevConfig->pvOSDevice;
- struct dma_map_ops *dma_ops = get_dma_ops(dev);
PVR_UNREFERENCED_PARAMETER(pvVirtStart);
PVR_UNREFERENCED_PARAMETER(pvVirtEnd);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
- dma_ops->sync_single_for_device(dev, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_TO_DEVICE);
-#else
- dma_ops->sync_single_for_device(NULL, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_TO_DEVICE);
-#endif
+ dma_sync_single_for_device(dev, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_TO_DEVICE);
}
void OSInvalidateCPUCacheRangeKM(PVRSRV_DEVICE_NODE *psDevNode,
@@ -161,16 +150,11 @@ void OSInvalidateCPUCacheRangeKM(PVRSRV_DEVICE_NODE *psDevNode,
IMG_CPU_PHYADDR sCPUPhysEnd)
{
struct device *dev = psDevNode->psDevConfig->pvOSDevice;
- struct dma_map_ops *dma_ops = get_dma_ops(dev);
PVR_UNREFERENCED_PARAMETER(pvVirtStart);
PVR_UNREFERENCED_PARAMETER(pvVirtEnd);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
- dma_ops->sync_single_for_cpu(dev, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_FROM_DEVICE);
-#else
- dma_ops->sync_single_for_cpu(NULL, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_FROM_DEVICE);
-#endif
+ dma_sync_single_for_cpu(dev, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_FROM_DEVICE);
}
PVRSRV_CACHE_OP_ADDR_TYPE OSCPUCacheOpAddressType(PVRSRV_CACHE_OP uiCacheOp)
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com> --- services/server/env/linux/osfunc_arm64.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-)