diff --git a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c index fb8686c21..1f7a76945 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c @@ -31,6 +31,8 @@ #include #include +#include "os_linux.h" + #include "clk.h" #include "gk20a/platform_gk20a.h" @@ -610,10 +612,10 @@ void gp10b_ecc_stat_remove(struct device *dev, nvgpu_kfree(g, dev_attr_array); } -void gr_gp10b_create_sysfs(struct device *dev) +void gr_gp10b_create_sysfs(struct gk20a *g) { int error = 0; - struct gk20a *g = get_gk20a(dev); + struct device *dev = dev_from_gk20a(g); /* This stat creation function is called on GR init. GR can get initialized multiple times but we only need to create the ECC diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 20e0450ec..7e7d96887 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -356,7 +356,7 @@ struct gpu_ops { u32 gpc_exception); void (*enable_gpc_exceptions)(struct gk20a *g); void (*enable_exceptions)(struct gk20a *g); - void (*create_gr_sysfs)(struct device *dev); + void (*create_gr_sysfs)(struct gk20a *g); u32 (*get_lrf_tex_ltc_dram_override)(struct gk20a *g); int (*record_sm_error_state)(struct gk20a *g, u32 gpc, u32 tpc); diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index a95368c3d..e30c595e4 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -4865,7 +4865,7 @@ static int gk20a_init_gr_setup_sw(struct gk20a *g) gr->sw_ready = true; if (g->ops.gr.create_gr_sysfs) - g->ops.gr.create_gr_sysfs(dev_from_gk20a(g)); + g->ops.gr.create_gr_sysfs(g); gk20a_dbg_fn("done"); return 0; diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h index a537f1478..45ac5305f 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h @@ -56,7 +56,7 @@ enum { int gr_gp10b_init_fs_state(struct gk20a *g); int gr_gp10b_alloc_buffer(struct vm_gk20a *vm, size_t size, struct nvgpu_mem *mem); -void gr_gp10b_create_sysfs(struct device *dev); +void gr_gp10b_create_sysfs(struct gk20a *g); int gr_gp10b_handle_fecs_error(struct gk20a *g, struct channel_gk20a *__ch, struct gr_gk20a_isr_data *isr_data);