mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-15 01:19:36 +00:00
rtl8188eu: Fix build for kernel 5.10
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
83dfb7ec00
commit
11bfbc2e3d
1 changed files with 18 additions and 0 deletions
|
@ -1091,15 +1091,19 @@ static int isFileReadable(const char *path, u32 *sz)
|
||||||
{
|
{
|
||||||
struct file *fp;
|
struct file *fp;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
#ifdef set_fs
|
||||||
mm_segment_t oldfs;
|
mm_segment_t oldfs;
|
||||||
|
#endif
|
||||||
char buf;
|
char buf;
|
||||||
|
|
||||||
fp = filp_open(path, O_RDONLY, 0);
|
fp = filp_open(path, O_RDONLY, 0);
|
||||||
if (IS_ERR(fp))
|
if (IS_ERR(fp))
|
||||||
ret = PTR_ERR(fp);
|
ret = PTR_ERR(fp);
|
||||||
else {
|
else {
|
||||||
|
#ifdef set_fs
|
||||||
oldfs = get_fs();
|
oldfs = get_fs();
|
||||||
set_fs(KERNEL_DS);
|
set_fs(KERNEL_DS);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (1 != readFile(fp, &buf, 1))
|
if (1 != readFile(fp, &buf, 1))
|
||||||
ret = PTR_ERR(fp);
|
ret = PTR_ERR(fp);
|
||||||
|
@ -1112,7 +1116,9 @@ static int isFileReadable(const char *path, u32 *sz)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef set_fs
|
||||||
set_fs(oldfs);
|
set_fs(oldfs);
|
||||||
|
#endif
|
||||||
filp_close(fp, NULL);
|
filp_close(fp, NULL);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1128,7 +1134,9 @@ static int isFileReadable(const char *path, u32 *sz)
|
||||||
static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
#ifdef set_fs
|
||||||
mm_segment_t oldfs;
|
mm_segment_t oldfs;
|
||||||
|
#endif
|
||||||
struct file *fp;
|
struct file *fp;
|
||||||
|
|
||||||
if (path && buf) {
|
if (path && buf) {
|
||||||
|
@ -1136,10 +1144,14 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
||||||
if (0 == ret) {
|
if (0 == ret) {
|
||||||
RTW_INFO("%s openFile path:%s fp=%p\n", __func__, path , fp);
|
RTW_INFO("%s openFile path:%s fp=%p\n", __func__, path , fp);
|
||||||
|
|
||||||
|
#ifdef set_fs
|
||||||
oldfs = get_fs();
|
oldfs = get_fs();
|
||||||
set_fs(KERNEL_DS);
|
set_fs(KERNEL_DS);
|
||||||
|
#endif
|
||||||
ret = readFile(fp, buf, sz);
|
ret = readFile(fp, buf, sz);
|
||||||
|
#ifdef set_fs
|
||||||
set_fs(oldfs);
|
set_fs(oldfs);
|
||||||
|
#endif
|
||||||
closeFile(fp);
|
closeFile(fp);
|
||||||
|
|
||||||
RTW_INFO("%s readFile, ret:%d\n", __func__, ret);
|
RTW_INFO("%s readFile, ret:%d\n", __func__, ret);
|
||||||
|
@ -1163,7 +1175,9 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
||||||
static int storeToFile(const char *path, u8 *buf, u32 sz)
|
static int storeToFile(const char *path, u8 *buf, u32 sz)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
#ifdef set_fs
|
||||||
mm_segment_t oldfs;
|
mm_segment_t oldfs;
|
||||||
|
#endif
|
||||||
struct file *fp;
|
struct file *fp;
|
||||||
|
|
||||||
if (path && buf) {
|
if (path && buf) {
|
||||||
|
@ -1171,10 +1185,14 @@ static int storeToFile(const char *path, u8 *buf, u32 sz)
|
||||||
if (0 == ret) {
|
if (0 == ret) {
|
||||||
RTW_INFO("%s openFile path:%s fp=%p\n", __func__, path , fp);
|
RTW_INFO("%s openFile path:%s fp=%p\n", __func__, path , fp);
|
||||||
|
|
||||||
|
#ifdef set_fs
|
||||||
oldfs = get_fs();
|
oldfs = get_fs();
|
||||||
set_fs(KERNEL_DS);
|
set_fs(KERNEL_DS);
|
||||||
|
#endif
|
||||||
ret = writeFile(fp, buf, sz);
|
ret = writeFile(fp, buf, sz);
|
||||||
|
#ifdef set_fs
|
||||||
set_fs(oldfs);
|
set_fs(oldfs);
|
||||||
|
#endif
|
||||||
closeFile(fp);
|
closeFile(fp);
|
||||||
|
|
||||||
RTW_INFO("%s writeFile, ret:%d\n", __func__, ret);
|
RTW_INFO("%s writeFile, ret:%d\n", __func__, ret);
|
||||||
|
|
Loading…
Reference in a new issue