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
This commit is contained in:
Terje Bergstrom
2017-06-21 15:56:05 -07:00
committed by mobile promotions
parent 6f0fcbc667
commit bab823973b
43 changed files with 105 additions and 90 deletions

View File

@@ -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)) {