summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-04-08 15:48:48 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-04-13 16:13:50 -0400
commitf72d655eac654cdcb78596d5ec61313ff3389e3c (patch)
tree6f69e8fdc53837c4b5d0e296440dd7135bb931af /drivers
parent00775cafab4b86234347bffd05b8ad262db11b2f (diff)
gpu: nvgpu: Remove global gk20a_device
Remove static variable gk20a_device which held a pointer to struct device. nvgpu can serve multiple GPUs, so a static pointer does not work. Change-Id: I79faf5c26658490c955a9b15137e5f671650fd28 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1123940 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/debug_gk20a.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
index 369fbe29..c2285c8a 100644
--- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
@@ -32,7 +32,6 @@
32#include "hw_pbdma_gk20a.h" 32#include "hw_pbdma_gk20a.h"
33 33
34unsigned int gk20a_debug_trace_cmdbuf; 34unsigned int gk20a_debug_trace_cmdbuf;
35static struct device *gk20a_device;
36 35
37struct ch_state { 36struct ch_state {
38 int pid; 37 int pid;
@@ -336,12 +335,13 @@ void gk20a_debug_dump_device(void *data)
336 .fn = gk20a_debug_write_printk 335 .fn = gk20a_debug_write_printk
337 }; 336 };
338 struct gk20a *g; 337 struct gk20a *g;
338 struct device *dev = data;
339 339
340 /* In pre-silicon we don't need full spew on stuck syncpoint */ 340 /* In pre-silicon we don't need full spew on stuck syncpoint */
341 if (!tegra_platform_is_silicon()) 341 if (!tegra_platform_is_silicon())
342 return; 342 return;
343 343
344 g = gk20a_from_dev(gk20a_device); 344 g = gk20a_from_dev(dev);
345 /* HAL only initialized after 1st power-on */ 345 /* HAL only initialized after 1st power-on */
346 if (g->ops.debug.show_dump) 346 if (g->ops.debug.show_dump)
347 g->ops.debug.show_dump(g, &o); 347 g->ops.debug.show_dump(g, &o);
@@ -397,10 +397,6 @@ void gk20a_debug_init(struct device *dev)
397{ 397{
398 struct gk20a_platform *platform = dev_get_drvdata(dev); 398 struct gk20a_platform *platform = dev_get_drvdata(dev);
399 399
400 /* Store the first device */
401 if (!gk20a_device)
402 gk20a_device = dev;
403
404 platform->debugfs = debugfs_create_dir(dev_name(dev), NULL); 400 platform->debugfs = debugfs_create_dir(dev_name(dev), NULL);
405 if (platform->debugfs) { 401 if (platform->debugfs) {
406 platform->debugfs_alias = 402 platform->debugfs_alias =