From 972c42fddf13f658242a4f92124e5fcf194672b3 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 27 Jul 2017 13:31:32 -0700 Subject: gpu: nvgpu: Move debugfs fields to os_linux Move all Linux specific debugfs dentry fields to struct nvgpu_os_linux. JIRA NVGPU-62 Change-Id: I615620005f5d042943dd2e478c1629bcc912c550 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1528263 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp106/clk_gp106.c | 11 ++++------- drivers/gpu/nvgpu/gp106/mclk_gp106.c | 6 ++---- drivers/gpu/nvgpu/gp106/therm_gp106.c | 5 ++--- drivers/gpu/nvgpu/gp106/xve_gp106.c | 18 +++++++++--------- 4 files changed, 17 insertions(+), 23 deletions(-) (limited to 'drivers/gpu/nvgpu/gp106') diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c index 105f8bd5..bcf95b01 100644 --- a/drivers/gpu/nvgpu/gp106/clk_gp106.c +++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c @@ -23,9 +23,6 @@ #include #include "gk20a/gk20a.h" -#ifdef CONFIG_DEBUG_FS -#include "gk20a/platform_gk20a.h" -#endif #include "common/linux/os_linux.h" #include "clk_gp106.h" @@ -240,10 +237,10 @@ static int gp106_get_rate_show(void *data , u64 *val) { DEFINE_SIMPLE_ATTRIBUTE(get_rate_fops, gp106_get_rate_show, NULL, "%llu\n"); -static int clk_gp106_debugfs_init(struct gk20a *g) { - struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); - - struct dentry *gpu_root = platform->debugfs; +static int clk_gp106_debugfs_init(struct gk20a *g) +{ + struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); + struct dentry *gpu_root = l->debugfs; struct dentry *clocks_root; struct dentry *d; unsigned int i; diff --git a/drivers/gpu/nvgpu/gp106/mclk_gp106.c b/drivers/gpu/nvgpu/gp106/mclk_gp106.c index 47ba4ea9..74c8aef3 100644 --- a/drivers/gpu/nvgpu/gp106/mclk_gp106.c +++ b/drivers/gpu/nvgpu/gp106/mclk_gp106.c @@ -18,7 +18,6 @@ #include "gk20a/gk20a.h" #ifdef CONFIG_DEBUG_FS -#include "gk20a/platform_gk20a.h" #include "common/linux/os_linux.h" #endif #include "gp106/mclk_gp106.h" @@ -3495,9 +3494,8 @@ static const struct file_operations mclk_switch_stats_fops = { static int mclk_debugfs_init(struct gk20a *g) { - struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); - - struct dentry *gpu_root = platform->debugfs; + struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); + struct dentry *gpu_root = l->debugfs; struct dentry *d; gk20a_dbg(gpu_dbg_info, "g=%p", g); diff --git a/drivers/gpu/nvgpu/gp106/therm_gp106.c b/drivers/gpu/nvgpu/gp106/therm_gp106.c index 4be8e6cd..4ec43293 100644 --- a/drivers/gpu/nvgpu/gp106/therm_gp106.c +++ b/drivers/gpu/nvgpu/gp106/therm_gp106.c @@ -18,7 +18,6 @@ #ifdef CONFIG_DEBUG_FS #include -#include "gk20a/platform_gk20a.h" #include "common/linux/os_linux.h" #endif @@ -72,11 +71,11 @@ DEFINE_SIMPLE_ATTRIBUTE(therm_ctrl_fops, therm_get_internal_sensor_curr_temp, NU void gp106_therm_debugfs_init(struct gk20a *g) { - struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); + struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); struct dentry *dbgentry; dbgentry = debugfs_create_file( - "temp", S_IRUGO, platform->debugfs, g, &therm_ctrl_fops); + "temp", S_IRUGO, l->debugfs, g, &therm_ctrl_fops); if (!dbgentry) nvgpu_err(g, "debugfs entry create failed for therm_curr_temp"); } diff --git a/drivers/gpu/nvgpu/gp106/xve_gp106.c b/drivers/gpu/nvgpu/gp106/xve_gp106.c index 77641240..67b77048 100644 --- a/drivers/gpu/nvgpu/gp106/xve_gp106.c +++ b/drivers/gpu/nvgpu/gp106/xve_gp106.c @@ -22,10 +22,10 @@ #include "gk20a/gk20a.h" #include "gm206/bios_gm206.h" #include "gp106/xve_gp106.h" - #ifdef CONFIG_DEBUG_FS #include "gk20a/platform_gk20a.h" #endif +#include "common/linux/os_linux.h" #include @@ -607,12 +607,12 @@ int xve_sw_init_gp106(struct device *dev) { int err = -ENODEV; #ifdef CONFIG_DEBUG_FS - struct gk20a *g = get_gk20a(dev); - struct gk20a_platform *plat = gk20a_get_platform(dev); - struct dentry *gpu_root = plat->debugfs; + struct gk20a *g = gk20a_from_dev(dev); + struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); + struct dentry *gpu_root = l->debugfs; - g->debugfs_xve = debugfs_create_dir("xve", gpu_root); - if (IS_ERR_OR_NULL(g->debugfs_xve)) + l->debugfs_xve = debugfs_create_dir("xve", gpu_root); + if (IS_ERR_OR_NULL(l->debugfs_xve)) goto fail; /* @@ -620,13 +620,13 @@ int xve_sw_init_gp106(struct device *dev) * worrying the higher level SW. */ debugfs_create_file("link_speed", S_IRUGO, - g->debugfs_xve, g, + l->debugfs_xve, g, &xve_link_speed_fops); debugfs_create_file("available_speeds", S_IRUGO, - g->debugfs_xve, g, + l->debugfs_xve, g, &xve_available_speeds_fops); debugfs_create_file("link_control_status", S_IRUGO, - g->debugfs_xve, g, + l->debugfs_xve, g, &xve_link_control_status_fops); err = 0; -- cgit v1.2.2