From b227e66e06cbf61ba2f593e0af2c4d3af0b2ce3f Mon Sep 17 00:00:00 2001 From: Sherry Sun Date: Tue, 15 Feb 2022 11:24:35 +0800 Subject: [PATCH] mxm_wifiex: fix the PDE_DATA build errors on L5.16 kernel L5.16 kernel patch commit a1c11021f19cb0a80f removed the PDE_DATA() and replace it with pde_data(), so need to change accordingly, otherwise will have the driver build errors. Signed-off-by: Sherry Sun Approved-by: Tian Yang --- mxm_wifiex/wlan_src/mlinux/moal_debug.c | 12 +++++++++--- mxm_wifiex/wlan_src/mlinux/moal_proc.c | 20 +++++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/mxm_wifiex/wlan_src/mlinux/moal_debug.c b/mxm_wifiex/wlan_src/mlinux/moal_debug.c index a158702..6da6f99 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_debug.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_debug.c @@ -743,7 +743,9 @@ static int woal_histogram_read(struct seq_file *sfp, void *data) static int woal_histogram_proc_open(struct inode *inode, struct file *file) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + return single_open(file, woal_histogram_read, pde_data(inode)); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) return single_open(file, woal_histogram_read, PDE_DATA(inode)); #else return single_open(file, woal_histogram_read, PDE(inode)->data); @@ -942,7 +944,9 @@ static int woal_log_read(struct seq_file *sfp, void *data) */ static int woal_log_proc_open(struct inode *inode, struct file *file) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + return single_open(file, woal_log_read, pde_data(inode)); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) return single_open(file, woal_log_read, PDE_DATA(inode)); #else return single_open(file, woal_log_read, PDE(inode)->data); @@ -1266,7 +1270,9 @@ static ssize_t woal_debug_write(struct file *f, const char __user *buf, static int woal_debug_proc_open(struct inode *inode, struct file *file) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + return single_open(file, woal_debug_read, pde_data(inode)); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) return single_open(file, woal_debug_read, PDE_DATA(inode)); #else return single_open(file, woal_debug_read, PDE(inode)->data); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_proc.c b/mxm_wifiex/wlan_src/mlinux/moal_proc.c index 8fc7b3e..af702c0 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_proc.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_proc.c @@ -358,7 +358,9 @@ exit: static int woal_info_proc_open(struct inode *inode, struct file *file) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + return single_open(file, woal_info_proc_read, pde_data(inode)); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) return single_open(file, woal_info_proc_read, PDE_DATA(inode)); #else return single_open(file, woal_info_proc_read, PDE(inode)->data); @@ -776,7 +778,9 @@ static int woal_config_read(struct seq_file *sfp, void *data) static int woal_config_proc_open(struct inode *inode, struct file *file) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + return single_open(file, woal_config_read, pde_data(inode)); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) return single_open(file, woal_config_read, PDE_DATA(inode)); #else return single_open(file, woal_config_read, PDE(inode)->data); @@ -851,7 +855,9 @@ done: static int woal_drv_dump_proc_open(struct inode *inode, struct file *file) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + return single_open(file, woal_drv_dump_read, pde_data(inode)); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) return single_open(file, woal_drv_dump_read, PDE_DATA(inode)); #else return single_open(file, woal_drv_dump_read, PDE(inode)->data); @@ -928,7 +934,9 @@ done: static int woal_fw_dump_proc_open(struct inode *inode, struct file *file) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + return single_open(file, woal_fw_dump_read, pde_data(inode)); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) return single_open(file, woal_fw_dump_read, PDE_DATA(inode)); #else return single_open(file, woal_fw_dump_read, PDE(inode)->data); @@ -978,7 +986,9 @@ static int woal_wifi_status_read(struct seq_file *sfp, void *data) static int woal_wifi_status_proc_open(struct inode *inode, struct file *file) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + return single_open(file, woal_wifi_status_read, pde_data(inode)); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) return single_open(file, woal_wifi_status_read, PDE_DATA(inode)); #else return single_open(file, woal_wifi_status_read, PDE(inode)->data);