mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
fix ST NFC driver compile error
Some API changed with Kernel 5.4 version fix ST NFC driver compile error on Kernel 5.4 Change-Id: I1be44a5405907e4d2abdf26c2723302b3063ec29 Signed-off-by: Ningkai Zhuang <zhuangnk1@lenovo.com> Reviewed-on: https://gerrit.mot.com/1702766 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zishang Zhou <zhouzs1@motorola.com> Reviewed-by: Tao Sun <suntao2@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
fbe4f1ca46
commit
b5a4e03b9f
1 changed files with 8 additions and 0 deletions
|
|
@ -384,11 +384,19 @@ static long st21nfc_dev_ioctl(struct file *filp, unsigned int cmd,
|
|||
* from the kernel perspective; so they look reversed.
|
||||
*/
|
||||
if (_IOC_DIR(cmd) & _IOC_READ)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0)
|
||||
ret = !access_ok((void __user *)arg, _IOC_SIZE(cmd));
|
||||
#else
|
||||
ret = !access_ok(VERIFY_WRITE,
|
||||
(void __user *)arg, _IOC_SIZE(cmd));
|
||||
#endif
|
||||
if (ret == 0 && _IOC_DIR(cmd) & _IOC_WRITE)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0)
|
||||
ret = !access_ok((void __user *)arg, _IOC_SIZE(cmd));
|
||||
#else
|
||||
ret = !access_ok(VERIFY_READ,
|
||||
(void __user *)arg, _IOC_SIZE(cmd));
|
||||
#endif
|
||||
if (ret)
|
||||
return -EFAULT;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue