diff options
author | Yoshiki Ito <ito.yoshiki001@jp.panasonic.com> | 2022-02-10 09:14:58 +0900 |
---|---|---|
committer | Yoshiki Ito <ito.yoshiki001@jp.panasonic.com> | 2022-02-16 06:01:39 +0000 |
commit | 4bc8daf28251e2384a06360882994d777dcf5276 (patch) | |
tree | 22acde8d76bd424e19a0189fe3c64ca7a286e8a2 | |
parent | 0526e9435d7646bf6c81af1b680c46fdf199438a (diff) |
Add support for evklib to use struct proc_opslamprey_12.1.9lamprey_12.1.8lamprey_12.1.7lamprey_12.1.6lamprey_12.1.5lamprey_12.1.4lamprey_12.1.3lamprey_12.1.20lamprey_12.1.2lamprey_12.1.19lamprey_12.1.18lamprey_12.1.17lamprey_12.1.16lamprey_12.1.15lamprey_12.1.14lamprey_12.1.13lamprey_12.1.12lamprey_12.1.11lamprey_12.1.10lamprey_12.1.1lamprey/12.1.9lamprey/12.1.8lamprey/12.1.7lamprey/12.1.6lamprey/12.1.5lamprey/12.1.4lamprey/12.1.3lamprey/12.1.20lamprey/12.1.2lamprey/12.1.19lamprey/12.1.18lamprey/12.1.17lamprey/12.1.16lamprey/12.1.15lamprey/12.1.14lamprey/12.1.13lamprey/12.1.12lamprey/12.1.11lamprey/12.1.10lamprey/12.1.112.1.912.1.812.1.712.1.612.1.512.1.412.1.312.1.2012.1.212.1.1912.1.1812.1.1712.1.1612.1.1512.1.1412.1.1312.1.1212.1.1112.1.1012.1.1lamprey
Kernel 5.6 and later replaced struct file_operations with struct proc_ops.
Enabling agl-refhw-h3 feature or virtio-aarch64 machine configuration
will cause build errors. This patch enables kernel-module-evklib to use
struct proc_ops at 5.6 and later to avoid the errors.
Bug-AGL: SPEC-4254
Signed-off-by: Yoshiki Ito <ito.yoshiki001@jp.panasonic.com>
Change-Id: Ie78913fc16d245403b7e283b8bdea94c7ea7d666
(cherry picked from commit 4bdea8fcad6ffd4bcb1bba404ebf30c344ab7dfe)
-rwxr-xr-x | module/kernel-module-evklib/evk_lib.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/module/kernel-module-evklib/evk_lib.c b/module/kernel-module-evklib/evk_lib.c index e6dd238..504b2e1 100755 --- 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 */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) +#define HAVE_PROC_OPS +#endif + #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); } +#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, @@ -1846,7 +1858,16 @@ static struct file_operations evk_proc_flag_fops = { .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, @@ -1854,7 +1875,16 @@ static struct file_operations evk_proc_flag64_fops = { .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, @@ -1862,6 +1892,7 @@ static struct file_operations evk_proc_queue_fops = { .llseek = seq_lseek, .release = single_release, }; +#endif /* HAVE_PROC_OPS */ #endif /*ENABLE_PROC_FS*/ __init int |