Adapted vm_operations_struct for kernels >= 4.11 stable-1.5
authorFlorian Pose <fp@igh.de>
Mon, 04 Sep 2017 17:12:59 +0200
branchstable-1.5
changeset 2681 9953c0d372ab
parent 2680 e6f324a3d8a0
child 2682 8d6833867a56
Adapted vm_operations_struct for kernels >= 4.11
master/cdev.c
--- a/master/cdev.c	Fri Aug 18 12:30:16 2017 +0200
+++ b/master/cdev.c	Mon Sep 04 17:12:59 2017 +0200
@@ -253,10 +253,15 @@
  * \return Zero on success, otherwise a negative error code.
  */
 static int eccdev_vma_fault(
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
         struct vm_area_struct *vma, /**< Virtual memory area. */
+#endif
         struct vm_fault *vmf /**< Fault data. */
         )
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+    struct vm_area_struct *vma = vmf->vma;
+#endif
     unsigned long offset = vmf->pgoff << PAGE_SHIFT;
     ec_cdev_priv_t *priv = (ec_cdev_priv_t *) vma->vm_private_data;
     struct page *page;