diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-11-27 10:57:52 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-11-27 10:57:52 -0800 |
commit | 0dd09bc02c1bad55e92306ca83b38b3cf48b9f40 (patch) | |
tree | 8823a881b53e0ced57b077a0ffee4fc55b06d8f2 /drivers/staging/rtl8723bs/os_dep/osdep_service.c | |
parent | 8f56e4ebe05c26c30e167519273843476e39e244 (diff) | |
parent | 0f6f8749872e7be6c083dc845bf4d45a7018b79c (diff) | |
download | linux-0dd09bc02c1bad55e92306ca83b38b3cf48b9f40.tar.gz linux-0dd09bc02c1bad55e92306ca83b38b3cf48b9f40.tar.bz2 linux-0dd09bc02c1bad55e92306ca83b38b3cf48b9f40.zip |
Merge tag 'staging-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging / iio updates from Greg KH:
"Here is the big staging and iio set of patches for the 5.5-rc1
release.
It's the usual huge collection of cleanup patches all over the
drivers/staging/ area, along with a new staging driver, and a bunch of
new IIO drivers as well.
Full details are in the shortlog, but all of these have been in
linux-next for a long time with no reported issues"
* tag 'staging-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (548 commits)
staging: vchiq: Have vchiq_dump_* functions return an error code
staging: vchiq: Refactor indentation in vchiq_dump_* functions
staging: fwserial: Fix Kconfig indentation (seven spaces)
staging: vchiq_dump: Replace min with min_t
staging: vchiq: Fix block comment format in vchiq_dump()
staging: octeon: indent with tabs instead of spaces
staging: comedi: usbduxfast: usbduxfast_ai_cmdtest rounding error
staging: most: core: remove sysfs attr remove_link
staging: vc04: Fix Kconfig indentation
staging: pi433: Fix Kconfig indentation
staging: nvec: Fix Kconfig indentation
staging: most: Fix Kconfig indentation
staging: fwserial: Fix Kconfig indentation
staging: fbtft: Fix Kconfig indentation
fbtft: Drop OF dependency
fbtft: Make use of device property API
fbtft: Drop useless #ifdef CONFIG_OF and dead code
fbtft: Describe function parameters in kernel-doc
fbtft: Make sure string is NULL terminated
staging: rtl8723bs: remove set but not used variable 'change', 'pos'
...
Diffstat (limited to 'drivers/staging/rtl8723bs/os_dep/osdep_service.c')
-rw-r--r-- | drivers/staging/rtl8723bs/os_dep/osdep_service.c | 136 |
1 files changed, 0 insertions, 136 deletions
diff --git a/drivers/staging/rtl8723bs/os_dep/osdep_service.c b/drivers/staging/rtl8723bs/os_dep/osdep_service.c index 25a80041ce87..f5614e56371e 100644 --- a/drivers/staging/rtl8723bs/os_dep/osdep_service.c +++ b/drivers/staging/rtl8723bs/os_dep/osdep_service.c @@ -65,142 +65,6 @@ void _rtw_init_queue(struct __queue *pqueue) spin_lock_init(&(pqueue->lock)); } -/* -* Open a file with the specific @param path, @param flag, @param mode -* @param fpp the pointer of struct file pointer to get struct file pointer while file opening is success -* @param path the path of the file to open -* @param flag file operation flags, please refer to linux document -* @param mode please refer to linux document -* @return Linux specific error code -*/ -static int openFile(struct file **fpp, char *path, int flag, int mode) -{ - struct file *fp; - - fp = filp_open(path, flag, mode); - if (IS_ERR(fp)) { - *fpp = NULL; - return PTR_ERR(fp); - } - else { - *fpp = fp; - return 0; - } -} - -/* -* Close the file with the specific @param fp -* @param fp the pointer of struct file to close -* @return always 0 -*/ -static int closeFile(struct file *fp) -{ - filp_close(fp, NULL); - return 0; -} - -static int readFile(struct file *fp, char *buf, int len) -{ - int rlen = 0, sum = 0; - - if (!fp->f_op || !fp->f_op->read) - return -EPERM; - - while (sum < len) { - rlen = kernel_read(fp, buf + sum, len - sum, &fp->f_pos); - if (rlen > 0) - sum += rlen; - else if (0 != rlen) - return rlen; - else - break; - } - - return sum; - -} - -/* -* Test if the specifi @param path is a file and readable -* @param path the path of the file to test -* @return Linux specific error code -*/ -static int isFileReadable(char *path) -{ - struct file *fp; - int ret = 0; - char buf; - - fp = filp_open(path, O_RDONLY, 0); - if (IS_ERR(fp)) - return PTR_ERR(fp); - - if (readFile(fp, &buf, 1) != 1) - ret = -EINVAL; - - filp_close(fp, NULL); - return ret; -} - -/* -* Open the file with @param path and retrive the file content into memory starting from @param buf for @param sz at most -* @param path the path of the file to open and read -* @param buf the starting address of the buffer to store file content -* @param sz how many bytes to read at most -* @return the byte we've read, or Linux specific error code -*/ -static int retriveFromFile(char *path, u8 *buf, u32 sz) -{ - int ret = -1; - struct file *fp; - - if (path && buf) { - ret = openFile(&fp, path, O_RDONLY, 0); - - if (ret == 0) { - DBG_871X("%s openFile path:%s fp =%p\n", __func__, path , fp); - - ret = readFile(fp, buf, sz); - closeFile(fp); - - DBG_871X("%s readFile, ret:%d\n", __func__, ret); - - } else { - DBG_871X("%s openFile path:%s Fail, ret:%d\n", __func__, path, ret); - } - } else { - DBG_871X("%s NULL pointer\n", __func__); - ret = -EINVAL; - } - return ret; -} - -/* -* Test if the specifi @param path is a file and readable -* @param path the path of the file to test -* @return true or false -*/ -int rtw_is_file_readable(char *path) -{ - if (isFileReadable(path) == 0) - return true; - else - return false; -} - -/* -* Open the file with @param path and retrive the file content into memory starting from @param buf for @param sz at most -* @param path the path of the file to open and read -* @param buf the starting address of the buffer to store file content -* @param sz how many bytes to read at most -* @return the byte we've read -*/ -int rtw_retrive_from_file(char *path, u8 *buf, u32 sz) -{ - int ret = retriveFromFile(path, buf, sz); - return ret >= 0 ? ret : 0; -} - struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_priv) { struct net_device *pnetdev; |