From 08f87f769b595151be1afeff53e144f543faa614 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Wed, 06 Dec 2023 09:51:13 +0000
Subject: [PATCH] add dts config
---
kernel/drivers/net/wireless/rockchip_wlan/rtl8723cs/os_dep/osdep_service.c | 28 +++-------------------------
1 files changed, 3 insertions(+), 25 deletions(-)
diff --git a/kernel/drivers/net/wireless/rockchip_wlan/rtl8723cs/os_dep/osdep_service.c b/kernel/drivers/net/wireless/rockchip_wlan/rtl8723cs/os_dep/osdep_service.c
index 160a152..693f9de 100644
--- a/kernel/drivers/net/wireless/rockchip_wlan/rtl8723cs/os_dep/osdep_service.c
+++ b/kernel/drivers/net/wireless/rockchip_wlan/rtl8723cs/os_dep/osdep_service.c
@@ -2496,22 +2496,18 @@
{
struct file *fp;
int ret = 0;
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
mm_segment_t oldfs;
- #endif
char buf;
fp = filp_open(path, O_RDONLY, 0);
if (IS_ERR(fp))
ret = PTR_ERR(fp);
else {
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs();
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0))
set_fs(KERNEL_DS);
#else
- set_fs(get_ds());
- #endif
+ set_fs(KERNEL_DS);
#endif
if (1 != readFile(fp, &buf, 1))
@@ -2525,9 +2521,7 @@
#endif
}
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs);
- #endif
filp_close(fp, NULL);
}
return ret;
@@ -2543,9 +2537,7 @@
static int retriveFromFile(const char *path, u8 *buf, u32 sz)
{
int ret = -1;
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
mm_segment_t oldfs;
- #endif
struct file *fp;
if (path && buf) {
@@ -2553,20 +2545,14 @@
if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs();
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0))
set_fs(KERNEL_DS);
#else
- set_fs(get_ds());
+ set_fs(KERNEL_DS);
#endif
- #endif
-
ret = readFile(fp, buf, sz);
-
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs);
- #endif
closeFile(fp);
RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret);
@@ -2590,9 +2576,7 @@
static int storeToFile(const char *path, u8 *buf, u32 sz)
{
int ret = 0;
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
mm_segment_t oldfs;
- #endif
struct file *fp;
if (path && buf) {
@@ -2600,20 +2584,14 @@
if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs();
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0))
set_fs(KERNEL_DS);
#else
- set_fs(get_ds());
+ set_fs(KERNEL_DS);
#endif
- #endif
-
ret = writeFile(fp, buf, sz);
-
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs);
- #endif
closeFile(fp);
RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret);
--
Gitblit v1.6.2