rk: ion: modify the ION_IOC_XXX name easy to understand
authorCMY <cmy@rock-chips.com>
Tue, 25 Feb 2014 09:23:06 +0000 (17:23 +0800)
committerCMY <cmy@rock-chips.com>
Tue, 25 Feb 2014 09:26:01 +0000 (17:26 +0800)
drivers/staging/android/ion/rockchip/rockchip_ion.c
include/linux/rockchip_ion.h

index c3b6148ab178e1067595ef0854cd14916a4b3638..3f23567f941c0c92edb2d5d1050e631d04d3b0b5 100755 (executable)
@@ -195,43 +195,43 @@ static long rockchip_custom_ioctl (struct ion_client *client, unsigned int cmd,
                        return -EFAULT;
                break;
        }
-       case ION_IOC_GET_SHARE:
+       case ION_IOC_GET_SHARE_ID:
        {
-               struct ion_share_obj_data data;
+               struct ion_share_id_data data;
                struct dma_buf *dmabuf = NULL;
 
                if (copy_from_user(&data, (void __user *)arg,
-                                       sizeof(struct ion_share_obj_data)))
+                                       sizeof(struct ion_share_id_data)))
                        return -EFAULT;
 
                dmabuf = dma_buf_get(data.fd);
                if (IS_ERR(dmabuf))
                        return PTR_ERR(dmabuf);
 
-               data.obj = (void*)dmabuf;
+               data.id = (unsigned int)dmabuf;
                dma_buf_put(dmabuf);
 
-               if (copy_to_user((void __user *)arg, &data, sizeof(struct ion_share_obj_data)))
+               if (copy_to_user((void __user *)arg, &data, sizeof(struct ion_share_id_data)))
                        return -EFAULT;
 
                break;
        }
-       case ION_IOC_SET_SHARE:
+       case ION_IOC_SHARE_BY_ID:
        {
-               struct ion_share_obj_data data;
+               struct ion_share_id_data data;
                int fd = 0;
 
                if (copy_from_user(&data, (void __user *)arg,
-                                       sizeof(struct ion_share_obj_data)))
+                                       sizeof(struct ion_share_id_data)))
                        return -EFAULT;
 
-               fd = dma_buf_fd((struct dma_buf*)data.obj, O_CLOEXEC);
+               fd = dma_buf_fd((struct dma_buf*)data.id, O_CLOEXEC);
                if (fd < 0)
                        return fd;
 
                data.fd = fd;
 
-               if (copy_to_user((void __user *)arg, &data, sizeof(struct ion_share_obj_data)))
+               if (copy_to_user((void __user *)arg, &data, sizeof(struct ion_share_id_data)))
                        return -EFAULT;
 
                break;
index 4e78235cba31adaa69211ef0788f350920a02ea5..f674e11416dfc25f040d97d227f869ae431a6658 100644 (file)
@@ -70,9 +70,9 @@ struct ion_phys_data {
        unsigned long size;
 };
 
-struct ion_share_obj_data {
+struct ion_share_id_data {
        int fd;
-       void *obj;
+       unsigned int id;
 };
 
 #define ION_IOC_ROCKCHIP_MAGIC 'R'
@@ -102,13 +102,13 @@ struct ion_share_obj_data {
 /**
  * Get share object of the fd specified.
  */
-#define ION_IOC_GET_SHARE      _IOWR(ION_IOC_ROCKCHIP_MAGIC, 4, \
-                                               struct ion_share_obj_data)
+#define ION_IOC_GET_SHARE_ID   _IOWR(ION_IOC_ROCKCHIP_MAGIC, 4, \
+                                               struct ion_share_id_data)
 
 /**
  * Set share object and associate new fd.
  */
-#define ION_IOC_SET_SHARE      _IOWR(ION_IOC_ROCKCHIP_MAGIC, 5, \
-                                               struct ion_share_obj_data)
+#define ION_IOC_SHARE_BY_ID    _IOWR(ION_IOC_ROCKCHIP_MAGIC, 5, \
+                                               struct ion_share_id_data)
 
 #endif