From 3e39798997f0726472e18a17462216094c084074 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 24 Mar 2017 10:55:46 -0700 Subject: gpu: nvgpu: Remove unnecessary use of dev_name() Move the name field from struct gpu_ops up to struct gk20a. The field is not a function op, so it doesn't belong in gpu_ops. Replace all uses of dev_name() with use of g->name when possible. JIRA NVGPU-16 Change-Id: Ic6e99e39258cbf3bb7c806962cbbd7de5126688f Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1328534 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c index 1ae42337..97125a99 100644 --- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c @@ -198,7 +198,6 @@ static int gk20a_ctrl_alloc_as( struct gk20a *g, struct nvgpu_alloc_as_args *args) { - struct device *dev = g->dev; struct gk20a_as_share *as_share; int err; int fd; @@ -211,7 +210,7 @@ static int gk20a_ctrl_alloc_as( fd = err; name = kasprintf(GFP_KERNEL, "nvhost-%s-fd%d", - dev_name(dev), fd); + g->name, fd); file = anon_inode_getfile(name, g->as.cdev.ops, NULL, O_RDWR); kfree(name); @@ -241,7 +240,6 @@ clean_up: static int gk20a_ctrl_open_tsg(struct gk20a *g, struct nvgpu_gpu_open_tsg_args *args) { - struct device *dev = g->dev; int err; int fd; struct file *file; @@ -253,7 +251,7 @@ static int gk20a_ctrl_open_tsg(struct gk20a *g, fd = err; name = kasprintf(GFP_KERNEL, "nvgpu-%s-tsg%d", - dev_name(dev), fd); + g->name, fd); file = anon_inode_getfile(name, g->tsg.cdev.ops, NULL, O_RDWR); kfree(name); -- cgit v1.2.2