af453ec307690862a812cbc06536e3e61e954cb8
[openwrt/staging/noltari.git] / target / linux / brcm2708 / patches-4.19 / 950-0701-vc-sm-cma-Fix-compatibility-ioctl.patch
1 From a24a0a621486b36bcdf5c5e0afb05a5d1dd30003 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Mon, 19 Aug 2019 15:45:20 +0100
4 Subject: [PATCH] vc-sm-cma: Fix compatibility ioctl
5
6 This code path hasn't been used previously.
7 Fixed up after testing with kodi on 32-bit userland and 64-bit kernel
8
9 Signed-off-by: popcornmix <popcornmix@gmail.com>
10 ---
11 drivers/staging/vc04_services/vc-sm-cma/vc_sm.c | 12 ++++--------
12 1 file changed, 4 insertions(+), 8 deletions(-)
13
14 --- a/drivers/staging/vc04_services/vc-sm-cma/vc_sm.c
15 +++ b/drivers/staging/vc04_services/vc-sm-cma/vc_sm.c
16 @@ -1501,11 +1501,10 @@ static long vc_sm_cma_ioctl(struct file
17 return ret;
18 }
19
20 -#ifndef CONFIG_ARM64
21 #ifdef CONFIG_COMPAT
22 struct vc_sm_cma_ioctl_clean_invalid2_32 {
23 u32 op_count;
24 - struct vc_sm_cma_ioctl_clean_invalid_block {
25 + struct vc_sm_cma_ioctl_clean_invalid_block_32 {
26 u16 invalidate_mode;
27 u16 block_count;
28 compat_uptr_t start_address;
29 @@ -1516,7 +1515,7 @@ struct vc_sm_cma_ioctl_clean_invalid2_32
30
31 #define VC_SM_CMA_CMD_CLEAN_INVALID2_32\
32 _IOR(VC_SM_CMA_MAGIC_TYPE, VC_SM_CMA_CMD_CLEAN_INVALID2,\
33 - struct vc_sm_cma_ioctl_clean_invalid2)
34 + struct vc_sm_cma_ioctl_clean_invalid2_32)
35
36 static long vc_sm_cma_compat_ioctl(struct file *file, unsigned int cmd,
37 unsigned long arg)
38 @@ -1524,24 +1523,21 @@ static long vc_sm_cma_compat_ioctl(struc
39 switch (cmd) {
40 case VC_SM_CMA_CMD_CLEAN_INVALID2_32:
41 /* FIXME */
42 - break;
43 + return -EINVAL;
44
45 default:
46 - return vc_sm_cma_compat_ioctl(file, cmd, arg);
47 + return vc_sm_cma_ioctl(file, cmd, arg);
48 }
49 }
50 #endif
51 -#endif
52
53 /* Device operations that we managed in this driver. */
54 static const struct file_operations vc_sm_ops = {
55 .owner = THIS_MODULE,
56 .unlocked_ioctl = vc_sm_cma_ioctl,
57 -#ifndef CONFIG_ARM64
58 #ifdef CONFIG_COMPAT
59 .compat_ioctl = vc_sm_cma_compat_ioctl,
60 #endif
61 -#endif
62 .open = vc_sm_cma_open,
63 .release = vc_sm_cma_release,
64 };