ion: export ion handle get/put
authorMark Yao <mark.yao@rock-chips.com>
Wed, 3 Dec 2014 01:48:50 +0000 (09:48 +0800)
committerMark Yao <mark.yao@rock-chips.com>
Wed, 3 Dec 2014 03:40:54 +0000 (11:40 +0800)
use ion handle get/put, we can easyly protect the buffer when we
use it.

Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/staging/android/ion/ion.c
drivers/staging/android/ion/ion.h

index 837f51104aefc001bd5653ed237cf8710e356a6b..bde5f6eeb0873fd29dc5dde999205987a1c5464c 100755 (executable)
@@ -402,7 +402,7 @@ struct ion_buffer *ion_handle_buffer(struct ion_handle *handle)
        return handle->buffer;
 }
 
-static void ion_handle_get(struct ion_handle *handle)
+void ion_handle_get(struct ion_handle *handle)
 {
        kref_get(&handle->ref);
 }
index 05f6382ccb1583b30e0f2da58d60ac375949c296..a9ed374c641187f9a2bb0e97ae11514cbb423bdf 100755 (executable)
@@ -201,6 +201,15 @@ int ion_share_dma_buf_fd(struct ion_client *client, struct ion_handle *handle);
  */
 struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd);
 
+/**
+ * ion_handle_get() - ref ion buffer.
+ */
+void ion_handle_get(struct ion_handle *handle);
+/**
+ * ion_handle_put() - unref ion buffer.
+ */
+int ion_handle_put(struct ion_handle *handle);
+
 #ifdef CONFIG_ARCH_ROCKCHIP
 struct device;