diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-06-21 18:56:05 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-30 21:34:59 -0400 |
commit | bab823973b0630e2f4515d5aabbe4fb46cdf3195 (patch) | |
tree | 9e19ed71ed9a57b15a3f3b48ffbbbc1b196bf4d6 /drivers/gpu/nvgpu/common/linux/ioctl_channel.c | |
parent | 6f0fcbc667ca55ed25818467069853e6d750cd7d (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/ioctl_channel.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_channel.c | 9 |
1 files changed, 5 insertions, 4 deletions
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 @@ | |||
32 | #include "gk20a/ctxsw_trace_gk20a.h" | 32 | #include "gk20a/ctxsw_trace_gk20a.h" |
33 | #include "gk20a/dbg_gpu_gk20a.h" | 33 | #include "gk20a/dbg_gpu_gk20a.h" |
34 | #include "gk20a/fence_gk20a.h" | 34 | #include "gk20a/fence_gk20a.h" |
35 | #include "gk20a/platform_gk20a.h" | ||
35 | #include "ioctl_channel.h" | 36 | #include "ioctl_channel.h" |
36 | #include "os_linux.h" | 37 | #include "os_linux.h" |
37 | 38 | ||
@@ -291,7 +292,7 @@ int gk20a_channel_release(struct inode *inode, struct file *filp) | |||
291 | goto channel_release; | 292 | goto channel_release; |
292 | } | 293 | } |
293 | 294 | ||
294 | trace_gk20a_channel_release(dev_name(g->dev)); | 295 | trace_gk20a_channel_release(dev_name(dev_from_gk20a(g))); |
295 | 296 | ||
296 | gk20a_channel_close(ch); | 297 | gk20a_channel_close(ch); |
297 | gk20a_channel_free_error_notifiers(ch); | 298 | gk20a_channel_free_error_notifiers(ch); |
@@ -319,7 +320,7 @@ static int __gk20a_channel_open(struct gk20a *g, | |||
319 | if (!g) | 320 | if (!g) |
320 | return -ENODEV; | 321 | return -ENODEV; |
321 | 322 | ||
322 | trace_gk20a_channel_open(dev_name(g->dev)); | 323 | trace_gk20a_channel_open(dev_name(dev_from_gk20a(g))); |
323 | 324 | ||
324 | priv = nvgpu_kzalloc(g, sizeof(*priv)); | 325 | priv = nvgpu_kzalloc(g, sizeof(*priv)); |
325 | if (!priv) { | 326 | if (!priv) { |
@@ -388,7 +389,7 @@ int gk20a_channel_open_ioctl(struct gk20a *g, | |||
388 | fd = err; | 389 | fd = err; |
389 | 390 | ||
390 | snprintf(name, sizeof(name), "nvhost-%s-fd%d", | 391 | snprintf(name, sizeof(name), "nvhost-%s-fd%d", |
391 | dev_name(g->dev), fd); | 392 | dev_name(dev_from_gk20a(g)), fd); |
392 | 393 | ||
393 | file = anon_inode_getfile(name, l->channel.cdev.ops, NULL, O_RDWR); | 394 | file = anon_inode_getfile(name, l->channel.cdev.ops, NULL, O_RDWR); |
394 | if (IS_ERR(file)) { | 395 | if (IS_ERR(file)) { |
@@ -841,7 +842,7 @@ long gk20a_channel_ioctl(struct file *filp, | |||
841 | { | 842 | { |
842 | struct channel_priv *priv = filp->private_data; | 843 | struct channel_priv *priv = filp->private_data; |
843 | struct channel_gk20a *ch = priv->c; | 844 | struct channel_gk20a *ch = priv->c; |
844 | struct device *dev = ch->g->dev; | 845 | struct device *dev = dev_from_gk20a(ch->g); |
845 | u8 buf[NVGPU_IOCTL_CHANNEL_MAX_ARG_SIZE] = {0}; | 846 | u8 buf[NVGPU_IOCTL_CHANNEL_MAX_ARG_SIZE] = {0}; |
846 | int err = 0; | 847 | int err = 0; |
847 | 848 | ||