diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index caf8d309..5c5ac645 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include "gk20a/gk20a.h" | 31 | #include "gk20a/gk20a.h" |
32 | #include "gk20a/platform_gk20a.h" | 32 | #include "gk20a/platform_gk20a.h" |
33 | #include "gk20a/fence_gk20a.h" | 33 | #include "gk20a/fence_gk20a.h" |
34 | #include "os_linux.h" | ||
34 | 35 | ||
35 | #include <nvgpu/log.h> | 36 | #include <nvgpu/log.h> |
36 | 37 | ||
@@ -48,15 +49,16 @@ struct gk20a_ctrl_priv { | |||
48 | 49 | ||
49 | int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp) | 50 | int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp) |
50 | { | 51 | { |
52 | struct nvgpu_os_linux *l; | ||
51 | struct gk20a *g; | 53 | struct gk20a *g; |
52 | struct gk20a_ctrl_priv *priv; | 54 | struct gk20a_ctrl_priv *priv; |
53 | int err = 0; | 55 | int err = 0; |
54 | 56 | ||
55 | gk20a_dbg_fn(""); | 57 | gk20a_dbg_fn(""); |
56 | 58 | ||
57 | g = container_of(inode->i_cdev, | 59 | l = container_of(inode->i_cdev, |
58 | struct gk20a, ctrl.cdev); | 60 | struct nvgpu_os_linux, ctrl.cdev); |
59 | g = gk20a_get(g); | 61 | g = gk20a_get(&l->g); |
60 | if (!g) | 62 | if (!g) |
61 | return -ENODEV; | 63 | return -ENODEV; |
62 | 64 | ||
@@ -199,6 +201,7 @@ static int gk20a_ctrl_alloc_as( | |||
199 | struct gk20a *g, | 201 | struct gk20a *g, |
200 | struct nvgpu_alloc_as_args *args) | 202 | struct nvgpu_alloc_as_args *args) |
201 | { | 203 | { |
204 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | ||
202 | struct gk20a_as_share *as_share; | 205 | struct gk20a_as_share *as_share; |
203 | int err; | 206 | int err; |
204 | int fd; | 207 | int fd; |
@@ -212,7 +215,7 @@ static int gk20a_ctrl_alloc_as( | |||
212 | 215 | ||
213 | snprintf(name, sizeof(name), "nvhost-%s-fd%d", g->name, fd); | 216 | snprintf(name, sizeof(name), "nvhost-%s-fd%d", g->name, fd); |
214 | 217 | ||
215 | file = anon_inode_getfile(name, g->as_dev.cdev.ops, NULL, O_RDWR); | 218 | file = anon_inode_getfile(name, l->as_dev.cdev.ops, NULL, O_RDWR); |
216 | if (IS_ERR(file)) { | 219 | if (IS_ERR(file)) { |
217 | err = PTR_ERR(file); | 220 | err = PTR_ERR(file); |
218 | goto clean_up; | 221 | goto clean_up; |
@@ -239,6 +242,7 @@ clean_up: | |||
239 | static int gk20a_ctrl_open_tsg(struct gk20a *g, | 242 | static int gk20a_ctrl_open_tsg(struct gk20a *g, |
240 | struct nvgpu_gpu_open_tsg_args *args) | 243 | struct nvgpu_gpu_open_tsg_args *args) |
241 | { | 244 | { |
245 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | ||
242 | int err; | 246 | int err; |
243 | int fd; | 247 | int fd; |
244 | struct file *file; | 248 | struct file *file; |
@@ -251,7 +255,7 @@ static int gk20a_ctrl_open_tsg(struct gk20a *g, | |||
251 | 255 | ||
252 | snprintf(name, sizeof(name), "nvgpu-%s-tsg%d", g->name, fd); | 256 | snprintf(name, sizeof(name), "nvgpu-%s-tsg%d", g->name, fd); |
253 | 257 | ||
254 | file = anon_inode_getfile(name, g->tsg.cdev.ops, NULL, O_RDWR); | 258 | file = anon_inode_getfile(name, l->tsg.cdev.ops, NULL, O_RDWR); |
255 | if (IS_ERR(file)) { | 259 | if (IS_ERR(file)) { |
256 | err = PTR_ERR(file); | 260 | err = PTR_ERR(file); |
257 | goto clean_up; | 261 | goto clean_up; |