diff options
author | Xinyu Chen <xinyu.chen@freescale.com> | 2012-08-07 10:30:29 +0800 |
---|---|---|
committer | Xinyu Chen <xinyu.chen@freescale.com> | 2012-08-07 10:32:13 +0800 |
commit | 511f74fdef926a8e26d5aaa64135a4745a3e65fa (patch) | |
tree | a524bd0b37f002e5d3b4cef7be01ec732542bdd3 /drivers/gpu | |
parent | 6c65604f0fe6e60b50bb204fc05a0134f8ced60b (diff) |
ENGR00219578 ion: refine the ioctl of ION_IOC_PHYS
The ioctl should return 0 when successful.
And the physical address is returned by
the parameter structures.
Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/ion/ion.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c index 47ba2155e39b..e606d1bdd3c3 100644 --- a/drivers/gpu/ion/ion.c +++ b/drivers/gpu/ion/ion.c @@ -1015,18 +1015,22 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } case ION_IOC_PHYS: { - struct ion_handle_data data; + struct ion_phys_data data; ion_phys_addr_t phys; int len; bool valid; if (copy_from_user(&data, (void __user *)arg, - sizeof(struct ion_handle_data))) + sizeof(struct ion_phys_data))) return -EFAULT; valid = ion_phys(client, data.handle, &phys, &len); if (valid) - return 0; - return phys; + return -1; + data.phys = phys; + if (copy_to_user((void __user *)arg, &data, + sizeof(struct ion_phys_data))) + return -EFAULT; + return 0; } default: return -ENOTTY; |