From 563f6e0cb4a4a28e211216a8854d64e518e666ff Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Fri, 3 Apr 2020 12:17:32 +0200 Subject: [PATCH] Replaced dma_zalloc_coherent. --- devices/ccat/netdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/devices/ccat/netdev.c b/devices/ccat/netdev.c index f68193e5..b006d8f5 100644 --- a/devices/ccat/netdev.c +++ b/devices/ccat/netdev.c @@ -539,7 +539,12 @@ static int ccat_eth_priv_init_dma(struct ccat_eth_priv *priv) dma->dev = &pdev->dev; dma->size = CCAT_ALIGNMENT * 3; dma->base = +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) + /* since kernel 5 memory is zero'd implicitly */ + dma_alloc_coherent(dma->dev, dma->size, &dma->phys, GFP_KERNEL); +#else dma_zalloc_coherent(dma->dev, dma->size, &dma->phys, GFP_KERNEL); +#endif if (!dma->base || !dma->phys) { pr_err("init DMA memory failed.\n"); return -ENOMEM;