diff options
author | Dave Airlie <airlied@redhat.com> | 2017-04-13 04:41:38 +0300 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.com> | 2017-04-18 16:27:38 +0300 |
commit | d8f2ebaac650dc35db3bf5cf10e8ee1115b455f8 (patch) | |
tree | 090060672c15542296e506200bac6e71d566eae2 /drivers/dma-buf | |
parent | 2e38178e23e63b193654af9a11bb4a3cb4b999a5 (diff) | |
download | linux-d8f2ebaac650dc35db3bf5cf10e8ee1115b455f8.tar.xz |
sync_file: get rid of internal reference count.
sync_file uses the reference count of the file, the internal
kref was never getting moved past 1.
We can reintroduce this if we decide we need it later.
[airlied: fix buildbot warnings]
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170413014144.637-2-airlied@gmail.com
Diffstat (limited to 'drivers/dma-buf')
-rw-r--r-- | drivers/dma-buf/sync_file.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c index 2321035f6204..dc89b1d484e8 100644 --- a/drivers/dma-buf/sync_file.c +++ b/drivers/dma-buf/sync_file.c @@ -41,8 +41,6 @@ static struct sync_file *sync_file_alloc(void) if (IS_ERR(sync_file->file)) goto err; - kref_init(&sync_file->kref); - init_waitqueue_head(&sync_file->wq); INIT_LIST_HEAD(&sync_file->cb.node); @@ -277,22 +275,15 @@ err: } -static void sync_file_free(struct kref *kref) +static int sync_file_release(struct inode *inode, struct file *file) { - struct sync_file *sync_file = container_of(kref, struct sync_file, - kref); + struct sync_file *sync_file = file->private_data; if (test_bit(POLL_ENABLED, &sync_file->fence->flags)) dma_fence_remove_callback(sync_file->fence, &sync_file->cb); dma_fence_put(sync_file->fence); kfree(sync_file); -} - -static int sync_file_release(struct inode *inode, struct file *file) -{ - struct sync_file *sync_file = file->private_data; - kref_put(&sync_file->kref, sync_file_free); return 0; } |