From bab823973b0630e2f4515d5aabbe4fb46cdf3195 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 21 Jun 2017 15:56:05 -0700 Subject: 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 Reviewed-on: https://git-master/r/1507930 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/linux/nvhost.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/common/linux/nvhost.c') 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 @@ #include "nvhost_priv.h" #include "gk20a/gk20a.h" +#include "gk20a/platform_gk20a.h" int nvgpu_get_nvhost_dev(struct gk20a *g) { - struct device_node *np = g->dev->of_node; + struct device_node *np = dev_from_gk20a(g)->of_node; struct platform_device *host1x_pdev = NULL; const __be32 *host1x_ptr; @@ -151,7 +152,7 @@ int nvgpu_nvhost_syncpt_read_ext_check( int nvgpu_nvhost_create_symlink(struct gk20a *g) { - struct device *dev = g->dev; + struct device *dev = dev_from_gk20a(g); int err = 0; if (g->nvhost_dev && @@ -166,7 +167,7 @@ int nvgpu_nvhost_create_symlink(struct gk20a *g) void nvgpu_nvhost_remove_symlink(struct gk20a *g) { - struct device *dev = g->dev; + struct device *dev = dev_from_gk20a(g); if (g->nvhost_dev && (dev->parent != &g->nvhost_dev->host1x_pdev->dev)) { -- cgit v1.2.2