|
@@ -41,8 +41,6 @@ static struct sync_file *sync_file_alloc(void)
|
|
if (IS_ERR(sync_file->file))
|
|
if (IS_ERR(sync_file->file))
|
|
goto err;
|
|
goto err;
|
|
|
|
|
|
- kref_init(&sync_file->kref);
|
|
|
|
-
|
|
|
|
init_waitqueue_head(&sync_file->wq);
|
|
init_waitqueue_head(&sync_file->wq);
|
|
|
|
|
|
INIT_LIST_HEAD(&sync_file->cb.node);
|
|
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))
|
|
if (test_bit(POLL_ENABLED, &sync_file->fence->flags))
|
|
dma_fence_remove_callback(sync_file->fence, &sync_file->cb);
|
|
dma_fence_remove_callback(sync_file->fence, &sync_file->cb);
|
|
dma_fence_put(sync_file->fence);
|
|
dma_fence_put(sync_file->fence);
|
|
kfree(sync_file);
|
|
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;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|