49 lines
1.6 KiB
Diff
49 lines
1.6 KiB
Diff
|
From 64cd5169be2f2da24b0949a93aef2b3e40c4e4ec Mon Sep 17 00:00:00 2001
|
||
|
From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||
|
Date: Mon, 15 Feb 2021 12:28:44 +0100
|
||
|
Subject: [PATCH] wifi
|
||
|
|
||
|
Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||
|
---
|
||
|
.../net/wireless/rtl8188eu/os_dep/osdep_service.c | 13 +++++--------
|
||
|
1 files changed, 6 insertions(+), 8 deletions(-)
|
||
|
|
||
|
diff --git a/drivers/net/wireless/rtl8188eu/os_dep/osdep_service.c b/drivers/net/wireless/rtl8188eu/os_dep/osdep_service.c
|
||
|
index 27366fa09..c6b3f65bb 100644
|
||
|
--- a/drivers/net/wireless/rtl8188eu/os_dep/osdep_service.c
|
||
|
+++ b/drivers/net/wireless/rtl8188eu/os_dep/osdep_service.c
|
||
|
@@ -2276,7 +2276,7 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
||
|
static int storeToFile(const char *path, u8 *buf, u32 sz)
|
||
|
{
|
||
|
int ret = 0;
|
||
|
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||
|
+ #ifdef set_fs
|
||
|
mm_segment_t oldfs;
|
||
|
#endif
|
||
|
struct file *fp;
|
||
|
@@ -2285,17 +2285,14 @@ static int storeToFile(const char *path, u8 *buf, u32 sz)
|
||
|
ret = openFile(&fp, path, O_CREAT | O_WRONLY, 0666);
|
||
|
if (0 == ret) {
|
||
|
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
|
||
|
-
|
||
|
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||
|
+#ifdef set_fs
|
||
|
oldfs = get_fs();
|
||
|
set_fs(KERNEL_DS);
|
||
|
- #else
|
||
|
- set_fs(get_ds());
|
||
|
- #endif
|
||
|
ret = writeFile(fp, buf, sz);
|
||
|
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||
|
set_fs(oldfs);
|
||
|
- #endif
|
||
|
+#else
|
||
|
+ ret = writeFile(fp, buf, sz);
|
||
|
+#endif
|
||
|
closeFile(fp);
|
||
|
|
||
|
RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret);
|
||
|
--
|
||
|
Created with Armbian build tools https://github.com/armbian/build
|
||
|
|