ion: export ion handle get/put

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>
This commit is contained in:
Mark Yao
2014-12-03 09:48:50 +08:00
parent 52e5c707fc
commit dec12c59c7
2 changed files with 10 additions and 1 deletions

View File

@@ -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);
}

View File

@@ -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;