hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux_exportfs.c
old mode 100644new mode 100755
....@@ -59,9 +59,7 @@
5959 {
6060 int ret = BCME_ERROR;
6161 if (inode) {
62
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
63
- ret = single_open(file, 0, pde_data(inode));
64
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
62
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
6563 ret = single_open(file, 0, PDE_DATA(inode));
6664 #else
6765 /* This feature is not supported for lower kernel versions */
....@@ -1193,8 +1191,8 @@
11931191 int ret = 0;
11941192
11951193 /* Read memdump info from the file */
1196
- fp = dhd_filp_open(filepath, O_RDONLY, 0);
1197
- if (IS_ERR(fp) || (fp == NULL)) {
1194
+ fp = filp_open(filepath, O_RDONLY, 0);
1195
+ if (IS_ERR(fp)) {
11981196 DHD_ERROR(("%s: File [%s] doesn't exist\n", __FUNCTION__, filepath));
11991197 #if defined(CONFIG_X86) && defined(OEM_ANDROID)
12001198 /* Check if it is Live Brix Image */
....@@ -1204,8 +1202,8 @@
12041202 /* Try if it is Installed Brix Image */
12051203 filepath = MEMDUMPINFO_INST;
12061204 DHD_ERROR(("%s: Try File [%s]\n", __FUNCTION__, filepath));
1207
- fp = dhd_filp_open(filepath, O_RDONLY, 0);
1208
- if (IS_ERR(fp) || (fp == NULL)) {
1205
+ fp = filp_open(filepath, O_RDONLY, 0);
1206
+ if (IS_ERR(fp)) {
12091207 DHD_ERROR(("%s: File [%s] doesn't exist\n", __FUNCTION__, filepath));
12101208 goto done;
12111209 }
....@@ -1215,10 +1213,10 @@
12151213 }
12161214
12171215 /* Handle success case */
1218
- ret = dhd_kernel_read_compat(fp, 0, (char *)&mem_val, sizeof(uint32));
1216
+ ret = kernel_read_compat(fp, 0, (char *)&mem_val, sizeof(uint32));
12191217 if (ret < 0) {
12201218 DHD_ERROR(("%s: File read error, ret=%d\n", __FUNCTION__, ret));
1221
- dhd_filp_close(fp, NULL);
1219
+ filp_close(fp, NULL);
12221220 goto done;
12231221 }
12241222
....@@ -1226,7 +1224,7 @@
12261224 p_mem_val[sizeof(uint32) - 1] = '\0';
12271225 mem_val = bcm_atoi(p_mem_val);
12281226
1229
- dhd_filp_close(fp, NULL);
1227
+ filp_close(fp, NULL);
12301228
12311229 done:
12321230 return mem_val;
....@@ -1337,11 +1335,11 @@
13371335 * 2: Trigger Kernel crash by BUG()
13381336 * File doesn't exist: Keep default value (1).
13391337 */
1340
- fp = dhd_filp_open(filepath, O_RDONLY, 0);
1341
- if (IS_ERR(fp) || (fp == NULL)) {
1338
+ fp = filp_open(filepath, O_RDONLY, 0);
1339
+ if (IS_ERR(fp)) {
13421340 DHD_ERROR(("%s: File [%s] doesn't exist\n", __FUNCTION__, filepath));
13431341 } else {
1344
- int ret = dhd_kernel_read_compat(fp, 0, (char *)&mem_val, sizeof(uint32));
1342
+ int ret = kernel_read_compat(fp, 0, (char *)&mem_val, sizeof(uint32));
13451343 if (ret < 0) {
13461344 DHD_ERROR(("%s: File read error, ret=%d\n", __FUNCTION__, ret));
13471345 } else {
....@@ -1350,7 +1348,7 @@
13501348 mem_val = bcm_atoi(p_mem_val);
13511349 DHD_ERROR(("%s: ASSERT ENABLED = %d\n", __FUNCTION__, mem_val));
13521350 }
1353
- dhd_filp_close(fp, NULL);
1351
+ filp_close(fp, NULL);
13541352 }
13551353
13561354 #ifdef CUSTOMER_HW4_DEBUG