summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-03-24 13:55:46 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-28 15:05:03 -0400
commit3e39798997f0726472e18a17462216094c084074 (patch)
treecf68b3fff464c1217fa28ec27f6c612d5cfc66fb /drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
parent580c8112f08281332cefea16243fcfbf27cd6bdd (diff)
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 <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1328534 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c6
1 files changed, 2 insertions, 4 deletions
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(
198 struct gk20a *g, 198 struct gk20a *g,
199 struct nvgpu_alloc_as_args *args) 199 struct nvgpu_alloc_as_args *args)
200{ 200{
201 struct device *dev = g->dev;
202 struct gk20a_as_share *as_share; 201 struct gk20a_as_share *as_share;
203 int err; 202 int err;
204 int fd; 203 int fd;
@@ -211,7 +210,7 @@ static int gk20a_ctrl_alloc_as(
211 fd = err; 210 fd = err;
212 211
213 name = kasprintf(GFP_KERNEL, "nvhost-%s-fd%d", 212 name = kasprintf(GFP_KERNEL, "nvhost-%s-fd%d",
214 dev_name(dev), fd); 213 g->name, fd);
215 214
216 file = anon_inode_getfile(name, g->as.cdev.ops, NULL, O_RDWR); 215 file = anon_inode_getfile(name, g->as.cdev.ops, NULL, O_RDWR);
217 kfree(name); 216 kfree(name);
@@ -241,7 +240,6 @@ clean_up:
241static int gk20a_ctrl_open_tsg(struct gk20a *g, 240static int gk20a_ctrl_open_tsg(struct gk20a *g,
242 struct nvgpu_gpu_open_tsg_args *args) 241 struct nvgpu_gpu_open_tsg_args *args)
243{ 242{
244 struct device *dev = g->dev;
245 int err; 243 int err;
246 int fd; 244 int fd;
247 struct file *file; 245 struct file *file;
@@ -253,7 +251,7 @@ static int gk20a_ctrl_open_tsg(struct gk20a *g,
253 fd = err; 251 fd = err;
254 252
255 name = kasprintf(GFP_KERNEL, "nvgpu-%s-tsg%d", 253 name = kasprintf(GFP_KERNEL, "nvgpu-%s-tsg%d",
256 dev_name(dev), fd); 254 g->name, fd);
257 255
258 file = anon_inode_getfile(name, g->tsg.cdev.ops, NULL, O_RDWR); 256 file = anon_inode_getfile(name, g->tsg.cdev.ops, NULL, O_RDWR);
259 kfree(name); 257 kfree(name);