From 2a502bdd5f3c93b87286456ca901ad43b0f14906 Mon Sep 17 00:00:00 2001 From: David Nieto Date: Mon, 13 Mar 2017 18:45:37 -0700 Subject: gpu: nvgpu: pass gk20a struct to gk20a_busy After driver remove, the device structure passed in gk20a_busy can be invalid. To solve this the prototype of the function is modified to pass the gk20a struct instead of the device pointer. bug 200277762 JIRA: EVLR-1023 Change-Id: I08eb74bd3578834d45115098ed9936ebbb436fdf Signed-off-by: David Nieto Reviewed-on: http://git-master/r/1320194 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker Reviewed-by: Terje Bergstrom GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gk20a/as_gk20a.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/as_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/as_gk20a.c b/drivers/gpu/nvgpu/gk20a/as_gk20a.c index a3c8c1ec..01c05d00 100644 --- a/drivers/gpu/nvgpu/gk20a/as_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/as_gk20a.c @@ -59,11 +59,11 @@ int gk20a_as_alloc_share(struct gk20a_as *as, as_share->id = generate_as_share_id(as_share->as); /* this will set as_share->vm. */ - err = gk20a_busy(g->dev); + err = gk20a_busy(g); if (err) goto failed; err = g->ops.mm.vm_alloc_share(as_share, big_page_size, flags); - gk20a_idle(g->dev); + gk20a_idle(g); if (err) goto failed; @@ -87,14 +87,14 @@ int gk20a_as_release_share(struct gk20a_as_share *as_share) gk20a_dbg_fn(""); - err = gk20a_busy(g->dev); + err = gk20a_busy(g); if (err) goto release_fail; err = gk20a_vm_release_share(as_share); - gk20a_idle(g->dev); + gk20a_idle(g); release_fail: release_as_share_id(as_share->as, as_share->id); @@ -375,7 +375,7 @@ long gk20a_as_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) return -EFAULT; } - err = gk20a_busy(g->dev); + err = gk20a_busy(g); if (err) return err; @@ -449,7 +449,7 @@ long gk20a_as_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) break; } - gk20a_idle(g->dev); + gk20a_idle(g); if ((err == 0) && (_IOC_DIR(cmd) & _IOC_READ)) if (copy_to_user((void __user *)arg, buf, _IOC_SIZE(cmd))) -- cgit v1.2.2