summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-06-21 18:56:05 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-30 21:34:59 -0400
commitbab823973b0630e2f4515d5aabbe4fb46cdf3195 (patch)
tree9e19ed71ed9a57b15a3f3b48ffbbbc1b196bf4d6 /drivers/gpu/nvgpu/vgpu
parent6f0fcbc667ca55ed25818467069853e6d750cd7d (diff)
gpu: nvgpu: Use accessor for finding struct device
Use dev_from_gk20a() accessor whenever accessing struct device * from struct gk20a. JIRA NVGPU-38 Change-Id: Ide9fca3a56436c8f62e7872580a766c4c1e2353e Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master/r/1507930 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu')
-rw-r--r--drivers/gpu/nvgpu/vgpu/css_vgpu.c2
-rw-r--r--drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c4
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.c3
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.h4
4 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/css_vgpu.c b/drivers/gpu/nvgpu/vgpu/css_vgpu.c
index d18ed100..a06ca037 100644
--- a/drivers/gpu/nvgpu/vgpu/css_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/css_vgpu.c
@@ -29,7 +29,7 @@ static struct tegra_hv_ivm_cookie *css_cookie;
29static int vgpu_css_init_snapshot_buffer(struct gr_gk20a *gr) 29static int vgpu_css_init_snapshot_buffer(struct gr_gk20a *gr)
30{ 30{
31 struct gk20a *g = gr->g; 31 struct gk20a *g = gr->g;
32 struct device *dev = g->dev; 32 struct device *dev = dev_from_gk20a(g);
33 struct gk20a_cs_snapshot *data = gr->cs_data; 33 struct gk20a_cs_snapshot *data = gr->cs_data;
34 struct device_node *np = dev->of_node; 34 struct device_node *np = dev->of_node;
35 struct of_phandle_args args; 35 struct of_phandle_args args;
diff --git a/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c b/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c
index af1631d8..7cab4d1e 100644
--- a/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -35,7 +35,7 @@ struct vgpu_fecs_trace {
35 35
36static int vgpu_fecs_trace_init(struct gk20a *g) 36static int vgpu_fecs_trace_init(struct gk20a *g)
37{ 37{
38 struct device *dev = g->dev; 38 struct device *dev = dev_from_gk20a(g);
39 struct device_node *np = dev->of_node; 39 struct device_node *np = dev->of_node;
40 struct of_phandle_args args; 40 struct of_phandle_args args;
41 struct device_node *hv_np; 41 struct device_node *hv_np;
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c
index da77dc19..f02acad0 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/vgpu.c
@@ -206,7 +206,8 @@ static int vgpu_intr_thread(void *dev_id)
206 206
207static void vgpu_remove_support(struct gk20a *g) 207static void vgpu_remove_support(struct gk20a *g)
208{ 208{
209 struct vgpu_priv_data *priv = vgpu_get_priv_data_from_dev(g->dev); 209 struct vgpu_priv_data *priv =
210 vgpu_get_priv_data_from_dev(dev_from_gk20a(g));
210 struct tegra_vgpu_intr_msg msg; 211 struct tegra_vgpu_intr_msg msg;
211 int err; 212 int err;
212 213
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.h b/drivers/gpu/nvgpu/vgpu/vgpu.h
index 31ecb737..92b82ac4 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.h
+++ b/drivers/gpu/nvgpu/vgpu/vgpu.h
@@ -41,7 +41,7 @@ struct vgpu_priv_data *vgpu_get_priv_data_from_dev(struct device *dev)
41 41
42static inline struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g) 42static inline struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g)
43{ 43{
44 return vgpu_get_priv_data_from_dev(g->dev); 44 return vgpu_get_priv_data_from_dev(dev_from_gk20a(g));
45} 45}
46 46
47static inline u64 vgpu_get_handle_from_dev(struct device *dev) 47static inline u64 vgpu_get_handle_from_dev(struct device *dev)
@@ -58,7 +58,7 @@ static inline u64 vgpu_get_handle_from_dev(struct device *dev)
58 58
59static inline u64 vgpu_get_handle(struct gk20a *g) 59static inline u64 vgpu_get_handle(struct gk20a *g)
60{ 60{
61 return vgpu_get_handle_from_dev(g->dev); 61 return vgpu_get_handle_from_dev(dev_from_gk20a(g));
62} 62}
63 63
64int vgpu_pm_prepare_poweroff(struct device *dev); 64int vgpu_pm_prepare_poweroff(struct device *dev);