diff options
author | Dave Airlie <airlied@redhat.com> | 2017-04-12 21:41:38 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.com> | 2017-04-18 09:27:38 -0400 |
commit | d8f2ebaac650dc35db3bf5cf10e8ee1115b455f8 (patch) | |
tree | 090060672c15542296e506200bac6e71d566eae2 /drivers/dma-buf | |
parent | 2e38178e23e63b193654af9a11bb4a3cb4b999a5 (diff) |
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) | |||
41 | if (IS_ERR(sync_file->file)) | 41 | if (IS_ERR(sync_file->file)) |
42 | goto err; | 42 | goto err; |
43 | 43 | ||
44 | kref_init(&sync_file->kref); | ||
45 | |||
46 | init_waitqueue_head(&sync_file->wq); | 44 | init_waitqueue_head(&sync_file->wq); |
47 | 45 | ||
48 | INIT_LIST_HEAD(&sync_file->cb.node); | 46 | INIT_LIST_HEAD(&sync_file->cb.node); |
@@ -277,22 +275,15 @@ err: | |||
277 | 275 | ||
278 | } | 276 | } |
279 | 277 | ||
280 | static void sync_file_free(struct kref *kref) | 278 | static int sync_file_release(struct inode *inode, struct file *file) |
281 | { | 279 | { |
282 | struct sync_file *sync_file = container_of(kref, struct sync_file, | 280 | struct sync_file *sync_file = file->private_data; |
283 | kref); | ||
284 | 281 | ||
285 | if (test_bit(POLL_ENABLED, &sync_file->fence->flags)) | 282 | if (test_bit(POLL_ENABLED, &sync_file->fence->flags)) |
286 | dma_fence_remove_callback(sync_file->fence, &sync_file->cb); | 283 | dma_fence_remove_callback(sync_file->fence, &sync_file->cb); |
287 | dma_fence_put(sync_file->fence); | 284 | dma_fence_put(sync_file->fence); |
288 | kfree(sync_file); | 285 | kfree(sync_file); |
289 | } | ||
290 | |||
291 | static int sync_file_release(struct inode *inode, struct file *file) | ||
292 | { | ||
293 | struct sync_file *sync_file = file->private_data; | ||
294 | 286 | ||
295 | kref_put(&sync_file->kref, sync_file_free); | ||
296 | return 0; | 287 | return 0; |
297 | } | 288 | } |
298 | 289 | ||