misc: mods: fix ioctl for writing into sysfs files

f_op->write doesn't always have to exist, it can be NULL.
Instead, use kernel function which handles this correctly.

Change-Id: I955bc1c2e97d3bfee3e5c7e48fefcbda4af1214c
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2457926
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Anand Nahar <anahar@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Chris Dragan
2020-12-10 00:36:19 -08:00
committed by Laxman Dewangan
parent a51241efac
commit 32e7a1caab
3 changed files with 65 additions and 32 deletions

View File

@@ -86,6 +86,10 @@
#endif
#endif
#if KERNEL_VERSION(4, 14, 0) <= MODS_KERNEL_VERSION
# define MODS_HAS_KERNEL_WRITE
#endif
#if KERNEL_VERSION(4, 16, 0) > MODS_KERNEL_VERSION && defined(CONFIG_X86)
# define MODS_HAS_MAP_SG_ATTRS
#endif