gpu: nvgpu: Remove Linux devnode fields from gk20a

Move Linux devnode related fields to a new header file os_linux.h.

The class structure is defined in module.c, so move its declaration
to module.h.

JIRA NVGPU-38

Change-Id: I5d8920169064f4289ff61004f7f81543a9aba221
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1505927
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2017-06-20 12:18:47 -07:00
committed by mobile promotions
parent 2ffbdc50d8
commit 92c43deefc
14 changed files with 177 additions and 112 deletions

View File

@@ -33,6 +33,7 @@
#include "gk20a/dbg_gpu_gk20a.h"
#include "gk20a/fence_gk20a.h"
#include "ioctl_channel.h"
#include "os_linux.h"
static void gk20a_channel_trace_sched_param(
void (*trace)(int chid, int tsgid, pid_t pid, u32 timeslice,
@@ -359,8 +360,9 @@ free_ref:
int gk20a_channel_open(struct inode *inode, struct file *filp)
{
struct gk20a *g = container_of(inode->i_cdev,
struct gk20a, channel.cdev);
struct nvgpu_os_linux *l = container_of(inode->i_cdev,
struct nvgpu_os_linux, channel.cdev);
struct gk20a *g = &l->g;
int ret;
gk20a_dbg_fn("start");
@@ -378,6 +380,7 @@ int gk20a_channel_open_ioctl(struct gk20a *g,
struct file *file;
char name[64];
s32 runlist_id = args->in.runlist_id;
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
err = get_unused_fd_flags(O_RDWR);
if (err < 0)
@@ -387,7 +390,7 @@ int gk20a_channel_open_ioctl(struct gk20a *g,
snprintf(name, sizeof(name), "nvhost-%s-fd%d",
dev_name(g->dev), fd);
file = anon_inode_getfile(name, g->channel.cdev.ops, NULL, O_RDWR);
file = anon_inode_getfile(name, l->channel.cdev.ops, NULL, O_RDWR);
if (IS_ERR(file)) {
err = PTR_ERR(file);
goto clean_up;