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/ioctl_channel.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_channel.c') diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c index 5905e5a6..2242e19e 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c @@ -32,6 +32,7 @@ #include "gk20a/ctxsw_trace_gk20a.h" #include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/fence_gk20a.h" +#include "gk20a/platform_gk20a.h" #include "ioctl_channel.h" #include "os_linux.h" @@ -291,7 +292,7 @@ int gk20a_channel_release(struct inode *inode, struct file *filp) goto channel_release; } - trace_gk20a_channel_release(dev_name(g->dev)); + trace_gk20a_channel_release(dev_name(dev_from_gk20a(g))); gk20a_channel_close(ch); gk20a_channel_free_error_notifiers(ch); @@ -319,7 +320,7 @@ static int __gk20a_channel_open(struct gk20a *g, if (!g) return -ENODEV; - trace_gk20a_channel_open(dev_name(g->dev)); + trace_gk20a_channel_open(dev_name(dev_from_gk20a(g))); priv = nvgpu_kzalloc(g, sizeof(*priv)); if (!priv) { @@ -388,7 +389,7 @@ int gk20a_channel_open_ioctl(struct gk20a *g, fd = err; snprintf(name, sizeof(name), "nvhost-%s-fd%d", - dev_name(g->dev), fd); + dev_name(dev_from_gk20a(g)), fd); file = anon_inode_getfile(name, l->channel.cdev.ops, NULL, O_RDWR); if (IS_ERR(file)) { @@ -841,7 +842,7 @@ long gk20a_channel_ioctl(struct file *filp, { struct channel_priv *priv = filp->private_data; struct channel_gk20a *ch = priv->c; - struct device *dev = ch->g->dev; + struct device *dev = dev_from_gk20a(ch->g); u8 buf[NVGPU_IOCTL_CHANNEL_MAX_ARG_SIZE] = {0}; int err = 0; -- cgit v1.2.2