diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/sync_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/sync_gk20a.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c index 1f2eae1a..da9a0f5e 100644 --- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c | |||
@@ -371,12 +371,11 @@ struct sync_timeline *gk20a_sync_timeline_create( | |||
371 | return &obj->obj; | 371 | return &obj->obj; |
372 | } | 372 | } |
373 | 373 | ||
374 | int gk20a_sync_fence_create(struct sync_timeline *obj, | 374 | struct sync_fence *gk20a_sync_fence_create(struct sync_timeline *obj, |
375 | struct gk20a_semaphore *sema, | 375 | struct gk20a_semaphore *sema, |
376 | struct sync_fence *dependency, | 376 | struct sync_fence *dependency, |
377 | const char *fmt, ...) | 377 | const char *fmt, ...) |
378 | { | 378 | { |
379 | int fd; | ||
380 | char name[30]; | 379 | char name[30]; |
381 | va_list args; | 380 | va_list args; |
382 | struct sync_pt *pt; | 381 | struct sync_pt *pt; |
@@ -385,7 +384,7 @@ int gk20a_sync_fence_create(struct sync_timeline *obj, | |||
385 | 384 | ||
386 | pt = gk20a_sync_pt_create_inst(timeline, sema, dependency); | 385 | pt = gk20a_sync_pt_create_inst(timeline, sema, dependency); |
387 | if (pt == NULL) | 386 | if (pt == NULL) |
388 | return -ENOMEM; | 387 | return NULL; |
389 | 388 | ||
390 | va_start(args, fmt); | 389 | va_start(args, fmt); |
391 | vsnprintf(name, sizeof(name), fmt, args); | 390 | vsnprintf(name, sizeof(name), fmt, args); |
@@ -394,15 +393,7 @@ int gk20a_sync_fence_create(struct sync_timeline *obj, | |||
394 | fence = sync_fence_create(name, pt); | 393 | fence = sync_fence_create(name, pt); |
395 | if (fence == NULL) { | 394 | if (fence == NULL) { |
396 | sync_pt_free(pt); | 395 | sync_pt_free(pt); |
397 | return -ENOMEM; | 396 | return NULL; |
398 | } | ||
399 | |||
400 | fd = get_unused_fd(); | ||
401 | if (fd < 0) { | ||
402 | sync_fence_put(fence); | ||
403 | return fd; | ||
404 | } | 397 | } |
405 | 398 | return fence; | |
406 | sync_fence_install(fence, fd); | ||
407 | return fd; | ||
408 | } | 399 | } |