diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 550b22c0..639ec4b5 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -511,7 +511,7 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) | |||
511 | /* | 511 | /* |
512 | * Free the gk20a struct. | 512 | * Free the gk20a struct. |
513 | */ | 513 | */ |
514 | static void gk20a_free_cb(struct kref *refcount) | 514 | static void gk20a_free_cb(struct nvgpu_ref *refcount) |
515 | { | 515 | { |
516 | struct gk20a *g = container_of(refcount, | 516 | struct gk20a *g = container_of(refcount, |
517 | struct gk20a, refcount); | 517 | struct gk20a, refcount); |
@@ -544,10 +544,11 @@ struct gk20a * __must_check gk20a_get(struct gk20a *g) | |||
544 | * the code will never be in such a situation that this race is | 544 | * the code will never be in such a situation that this race is |
545 | * possible. | 545 | * possible. |
546 | */ | 546 | */ |
547 | success = kref_get_unless_zero(&g->refcount); | 547 | success = nvgpu_ref_get_unless_zero(&g->refcount); |
548 | 548 | ||
549 | gk20a_dbg(gpu_dbg_shutdown, "GET: refs currently %d %s", | 549 | gk20a_dbg(gpu_dbg_shutdown, "GET: refs currently %d %s", |
550 | atomic_read(&g->refcount.refcount), success ? "" : "(FAILED)"); | 550 | nvgpu_atomic_read(&g->refcount.refcount), |
551 | success ? "" : "(FAILED)"); | ||
551 | 552 | ||
552 | return success ? g : NULL; | 553 | return success ? g : NULL; |
553 | } | 554 | } |
@@ -571,7 +572,7 @@ void gk20a_put(struct gk20a *g) | |||
571 | * ... Freeing GK20A struct! | 572 | * ... Freeing GK20A struct! |
572 | */ | 573 | */ |
573 | gk20a_dbg(gpu_dbg_shutdown, "PUT: refs currently %d", | 574 | gk20a_dbg(gpu_dbg_shutdown, "PUT: refs currently %d", |
574 | atomic_read(&g->refcount.refcount)); | 575 | nvgpu_atomic_read(&g->refcount.refcount)); |
575 | 576 | ||
576 | kref_put(&g->refcount, gk20a_free_cb); | 577 | nvgpu_ref_put(&g->refcount, gk20a_free_cb); |
577 | } | 578 | } |