summarylogtreecommitdiffstats
path: root/0004-adv_main-proc_create_data-kernel-5.6.patch
blob: 76d7e48b80082b57b4ce1aa1e877805934935326 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- driver/adv_main.c.orig	2020-05-20 23:34:17.254597551 -0400
+++ driver/adv_main.c	2020-05-20 23:37:12.236351943 -0400
@@ -257,18 +257,28 @@ unsigned int adv_proc_poll(struct file *
 	return mask;
 }
 
 extern int adv_proc_mmap(struct file *filp, struct vm_area_struct *vma);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
+static const struct proc_ops adv_proc_fops = {
+	.proc_open		= adv_proc_open,
+	.proc_release	= adv_proc_release,
+	.proc_mmap		= adv_proc_mmap,
+	.proc_ioctl	= adv_proc_ioctl,
+	.proc_poll		= adv_proc_poll,
+};
+#else
 static const struct file_operations adv_proc_fops = {
 	.owner		= THIS_MODULE,
 	.open		= adv_proc_open,
 	.release	= adv_proc_release,
 	.mmap		= adv_proc_mmap,
 	.unlocked_ioctl	= adv_proc_ioctl,
 	.poll		= adv_proc_poll,
 };
+#endif
 
 
 void adv_main_interrupt(struct adv_vcom * data, int mask)
 {
 	if(mask & ADV_INT_RX){