Code Review
/
staging
/
basesystem.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add support for evklib to use struct proc_ops
[staging/basesystem.git]
/
module
/
kernel-module-evklib
/
evk_lib.c
diff --git
a/module/kernel-module-evklib/evk_lib.c
b/module/kernel-module-evklib/evk_lib.c
index
e6dd238
..
504b2e1
100755
(executable)
--- a/
module/kernel-module-evklib/evk_lib.c
+++ b/
module/kernel-module-evklib/evk_lib.c
@@
-53,6
+53,10
@@
typedef __s32 INT32;
typedef __s64 INT64;
#endif /* !STANDARD_INT_DEFINITIONS */
typedef __s64 INT64;
#endif /* !STANDARD_INT_DEFINITIONS */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+#define HAVE_PROC_OPS
+#endif
+
#define ENABLE_PROC_FS 1
#define EVK_NAME "evk"
#define ENABLE_PROC_FS 1
#define EVK_NAME "evk"
@@
-1839,6
+1843,14
@@
evk_procFS_queue_open(struct inode *inode, struct file *file)
return single_open(file, evk_procFS_queue_show, NULL);
}
return single_open(file, evk_procFS_queue_show, NULL);
}
+#ifdef HAVE_PROC_OPS
+static struct proc_ops evk_proc_flag_fops = {
+ .proc_open = evk_procFS_flag_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+};
+#else
static struct file_operations evk_proc_flag_fops = {
.owner = THIS_MODULE,
.open = evk_procFS_flag_open,
static struct file_operations evk_proc_flag_fops = {
.owner = THIS_MODULE,
.open = evk_procFS_flag_open,
@@
-1846,7
+1858,16
@@
static struct file_operations evk_proc_flag_fops = {
.llseek = seq_lseek,
.release = single_release,
};
.llseek = seq_lseek,
.release = single_release,
};
-
+#endif /* HAVE_PROC_OPS */
+
+#ifdef HAVE_PROC_OPS
+static struct proc_ops evk_proc_flag64_fops = {
+ .proc_open = evk_procFS_flag64_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+};
+#else
static struct file_operations evk_proc_flag64_fops = {
.owner = THIS_MODULE,
.open = evk_procFS_flag64_open,
static struct file_operations evk_proc_flag64_fops = {
.owner = THIS_MODULE,
.open = evk_procFS_flag64_open,
@@
-1854,7
+1875,16
@@
static struct file_operations evk_proc_flag64_fops = {
.llseek = seq_lseek,
.release = single_release,
};
.llseek = seq_lseek,
.release = single_release,
};
-
+#endif /* HAVE_PROC_OPS */
+
+#ifdef HAVE_PROC_OPS
+static struct proc_ops evk_proc_queue_fops = {
+ .proc_open = evk_procFS_queue_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+};
+#else
static struct file_operations evk_proc_queue_fops = {
.owner = THIS_MODULE,
.open = evk_procFS_queue_open,
static struct file_operations evk_proc_queue_fops = {
.owner = THIS_MODULE,
.open = evk_procFS_queue_open,
@@
-1862,6
+1892,7
@@
static struct file_operations evk_proc_queue_fops = {
.llseek = seq_lseek,
.release = single_release,
};
.llseek = seq_lseek,
.release = single_release,
};
+#endif /* HAVE_PROC_OPS */
#endif /*ENABLE_PROC_FS*/
__init int
#endif /*ENABLE_PROC_FS*/
__init int