From: Michal MalĂ˝ <madcatxster@devoid-pointer.net>
Date: Fri, 27 Feb 2015 02:31:52 +0000 (+0100)
Subject: Use file_inode() helper on kernels 3.19 and above.
X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=e3fc4eb4463268cd1cad0b379d12be6082b17e5b;p=omnibook.git

Use file_inode() helper on kernels 3.19 and above.
---

diff --git a/init.c b/init.c
index 1536102..6d9685a 100644
--- a/init.c
+++ b/init.c
@@ -196,7 +196,11 @@ static int omnibook_feature_show(struct seq_file *m, void *v)
 }
 static ssize_t omnibook_feature_write(struct file *f, const char __user *userbuf, size_t s, loff_t *off)
 {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0))
+	struct omnibook_feature *feature = PDE_DATA(file_inode(f));
+#else
 	struct omnibook_feature *feature = PDE_DATA(f->f_dentry->d_inode);
+#endif
 	char *kernbuf;
 	int retval;