net: wireless: rockchip_wlan: bcmdhd: Call kernel_read/write() only when CONFIG_NO_GKI

kernel_read()/kernel_write() are missing from GKI symbol list.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Iad8f6749840d8fdc6c80c751a3d229e9f04359de
This commit is contained in:
Tao Huang
2022-07-27 19:47:16 +08:00
parent 1659a56516
commit 875964ad5d
2 changed files with 7 additions and 0 deletions

View File

@@ -931,8 +931,13 @@ static inline struct inode *file_inode(const struct file *f)
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
#ifdef CONFIG_NO_GKI
#define vfs_write(fp, buf, len, pos) kernel_write(fp, buf, len, pos)
#define vfs_read(fp, buf, len, pos) kernel_read(fp, buf, len, pos)
#else
#define vfs_write(fp, buf, len, pos) ({ UNUSED_PARAMETER(fp); UNUSED_PARAMETER(buf); UNUSED_PARAMETER(len); UNUSED_PARAMETER(pos); -EPERM; })
#define vfs_read(fp, buf, len, pos) ({ UNUSED_PARAMETER(fp); UNUSED_PARAMETER(buf); UNUSED_PARAMETER(len); UNUSED_PARAMETER(pos); -EPERM; })
#endif
int kernel_read_compat(struct file *file, loff_t offset, char *addr, unsigned long count);
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) */
#define kernel_read_compat(file, offset, addr, count) kernel_read(file, offset, addr, count)

View File

@@ -1939,6 +1939,8 @@ osl_timer_del(osl_t *osh, osl_timer_t *t)
int
kernel_read_compat(struct file *file, loff_t offset, char *addr, unsigned long count)
{
if (!IS_ENABLED(CONFIG_NO_GKI))
return -EPERM;
return (int)kernel_read(file, addr, (size_t)count, &offset);
}
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)) */