summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/nvhost.c
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/common/linux/nvhost.c
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/common/linux/nvhost.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/nvhost.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/nvhost.c b/drivers/gpu/nvgpu/common/linux/nvhost.c
index 96865f7d..8e337529 100644
--- a/drivers/gpu/nvgpu/common/linux/nvhost.c
+++ b/drivers/gpu/nvgpu/common/linux/nvhost.c
@@ -23,10 +23,11 @@
23#include "nvhost_priv.h" 23#include "nvhost_priv.h"
24 24
25#include "gk20a/gk20a.h" 25#include "gk20a/gk20a.h"
26#include "gk20a/platform_gk20a.h"
26 27
27int nvgpu_get_nvhost_dev(struct gk20a *g) 28int nvgpu_get_nvhost_dev(struct gk20a *g)
28{ 29{
29 struct device_node *np = g->dev->of_node; 30 struct device_node *np = dev_from_gk20a(g)->of_node;
30 struct platform_device *host1x_pdev = NULL; 31 struct platform_device *host1x_pdev = NULL;
31 const __be32 *host1x_ptr; 32 const __be32 *host1x_ptr;
32 33
@@ -151,7 +152,7 @@ int nvgpu_nvhost_syncpt_read_ext_check(
151 152
152int nvgpu_nvhost_create_symlink(struct gk20a *g) 153int nvgpu_nvhost_create_symlink(struct gk20a *g)
153{ 154{
154 struct device *dev = g->dev; 155 struct device *dev = dev_from_gk20a(g);
155 int err = 0; 156 int err = 0;
156 157
157 if (g->nvhost_dev && 158 if (g->nvhost_dev &&
@@ -166,7 +167,7 @@ int nvgpu_nvhost_create_symlink(struct gk20a *g)
166 167
167void nvgpu_nvhost_remove_symlink(struct gk20a *g) 168void nvgpu_nvhost_remove_symlink(struct gk20a *g)
168{ 169{
169 struct device *dev = g->dev; 170 struct device *dev = dev_from_gk20a(g);
170 171
171 if (g->nvhost_dev && 172 if (g->nvhost_dev &&
172 (dev->parent != &g->nvhost_dev->host1x_pdev->dev)) { 173 (dev->parent != &g->nvhost_dev->host1x_pdev->dev)) {