old mode 100644new mode 100755| .. | .. |
|---|
| 59 | 59 | { |
|---|
| 60 | 60 | int ret = BCME_ERROR; |
|---|
| 61 | 61 | 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)) |
|---|
| 65 | 63 | ret = single_open(file, 0, PDE_DATA(inode)); |
|---|
| 66 | 64 | #else |
|---|
| 67 | 65 | /* This feature is not supported for lower kernel versions */ |
|---|
| .. | .. |
|---|
| 1193 | 1191 | int ret = 0; |
|---|
| 1194 | 1192 | |
|---|
| 1195 | 1193 | /* 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)) { |
|---|
| 1198 | 1196 | DHD_ERROR(("%s: File [%s] doesn't exist\n", __FUNCTION__, filepath)); |
|---|
| 1199 | 1197 | #if defined(CONFIG_X86) && defined(OEM_ANDROID) |
|---|
| 1200 | 1198 | /* Check if it is Live Brix Image */ |
|---|
| .. | .. |
|---|
| 1204 | 1202 | /* Try if it is Installed Brix Image */ |
|---|
| 1205 | 1203 | filepath = MEMDUMPINFO_INST; |
|---|
| 1206 | 1204 | 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)) { |
|---|
| 1209 | 1207 | DHD_ERROR(("%s: File [%s] doesn't exist\n", __FUNCTION__, filepath)); |
|---|
| 1210 | 1208 | goto done; |
|---|
| 1211 | 1209 | } |
|---|
| .. | .. |
|---|
| 1215 | 1213 | } |
|---|
| 1216 | 1214 | |
|---|
| 1217 | 1215 | /* 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)); |
|---|
| 1219 | 1217 | if (ret < 0) { |
|---|
| 1220 | 1218 | DHD_ERROR(("%s: File read error, ret=%d\n", __FUNCTION__, ret)); |
|---|
| 1221 | | - dhd_filp_close(fp, NULL); |
|---|
| 1219 | + filp_close(fp, NULL); |
|---|
| 1222 | 1220 | goto done; |
|---|
| 1223 | 1221 | } |
|---|
| 1224 | 1222 | |
|---|
| .. | .. |
|---|
| 1226 | 1224 | p_mem_val[sizeof(uint32) - 1] = '\0'; |
|---|
| 1227 | 1225 | mem_val = bcm_atoi(p_mem_val); |
|---|
| 1228 | 1226 | |
|---|
| 1229 | | - dhd_filp_close(fp, NULL); |
|---|
| 1227 | + filp_close(fp, NULL); |
|---|
| 1230 | 1228 | |
|---|
| 1231 | 1229 | done: |
|---|
| 1232 | 1230 | return mem_val; |
|---|
| .. | .. |
|---|
| 1337 | 1335 | * 2: Trigger Kernel crash by BUG() |
|---|
| 1338 | 1336 | * File doesn't exist: Keep default value (1). |
|---|
| 1339 | 1337 | */ |
|---|
| 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)) { |
|---|
| 1342 | 1340 | DHD_ERROR(("%s: File [%s] doesn't exist\n", __FUNCTION__, filepath)); |
|---|
| 1343 | 1341 | } 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)); |
|---|
| 1345 | 1343 | if (ret < 0) { |
|---|
| 1346 | 1344 | DHD_ERROR(("%s: File read error, ret=%d\n", __FUNCTION__, ret)); |
|---|
| 1347 | 1345 | } else { |
|---|
| .. | .. |
|---|
| 1350 | 1348 | mem_val = bcm_atoi(p_mem_val); |
|---|
| 1351 | 1349 | DHD_ERROR(("%s: ASSERT ENABLED = %d\n", __FUNCTION__, mem_val)); |
|---|
| 1352 | 1350 | } |
|---|
| 1353 | | - dhd_filp_close(fp, NULL); |
|---|
| 1351 | + filp_close(fp, NULL); |
|---|
| 1354 | 1352 | } |
|---|
| 1355 | 1353 | |
|---|
| 1356 | 1354 | #ifdef CUSTOMER_HW4_DEBUG |
|---|