From f6e653817ae39ddd1daf31292ec7b41bc8b46841 Mon Sep 17 00:00:00 2001 From: Tatyana Nikolova Date: Tue, 21 Feb 2017 21:33:33 -0800 Subject: [PATCH] compat/nes: Adding pci_zalloc_consistent backport Signed-off-by: Tatyana Nikolova --- include/linux/compat-3.17.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/compat-3.17.h b/include/linux/compat-3.17.h index 0e5e424..848291f 100644 --- a/include/linux/compat-3.17.h +++ b/include/linux/compat-3.17.h @@ -3,9 +3,21 @@ #include #include "../../compat/config.h" +#include +#include +#include #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)) +#define pci_zalloc_consistent backport_pci_zalloc_consistent +static inline void * +backport_pci_zalloc_consistent(struct pci_dev *hwdev, size_t size, + dma_addr_t *dma_handle) +{ + return dma_zalloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, + size, dma_handle, GFP_ATOMIC); +} + #ifndef HAVE_KTIME_GET_REAL_NS #include #include -- 2.41.0