From b3e1ce04b963e91b9b425b3c35cc4eff11db7543 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 21 Apr 2017 12:42:57 -0700 Subject: gpu: nvgpu: Put debugfs dependencies inside #ifdef Put all debugfs dependencies inside #ifdef CONFIG_DEBUG_FS. This includes some functions in allocators that were used only for debugging. Remove include of linux/debugfs.h on files that do not deal with debugfs. linux/debugfs.h implicitly included linux/fs.h, which we relied on. Add explicit include of linux/fs.h for all files where this is the case. Change-Id: I16feffae6b0e3a2edf366075cdc01ade86be06f9 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1467897 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 4 ++++ drivers/gpu/nvgpu/gk20a/ce2_gk20a.c | 6 ++---- drivers/gpu/nvgpu/gk20a/clk_gk20a.c | 2 ++ drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c | 1 - drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h | 4 ++-- drivers/gpu/nvgpu/gk20a/debug_gk20a.c | 5 ++++- drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c | 2 ++ drivers/gpu/nvgpu/gk20a/fence_gk20a.c | 1 + drivers/gpu/nvgpu/gk20a/gk20a.h | 9 +++++++++ drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 1 - drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 2 ++ drivers/gpu/nvgpu/gk20a/sched_gk20a.c | 2 ++ drivers/gpu/nvgpu/gk20a/sched_gk20a.h | 1 + drivers/gpu/nvgpu/gk20a/therm_gk20a.c | 11 +++++------ 14 files changed, 36 insertions(+), 15 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index 391f6612..f0927692 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c @@ -18,7 +18,9 @@ #include #include +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include @@ -1662,6 +1664,7 @@ int gk20a_mark_compressible_write(struct gk20a *g, u32 buffer_fd, return 0; } +#ifdef CONFIG_DEBUG_FS static ssize_t gk20a_cde_reload_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { @@ -1694,3 +1697,4 @@ void gk20a_cde_debugfs_init(struct device *dev) debugfs_create_file("reload_cde_firmware", S_IWUSR, platform->debugfs, g, &gk20a_cde_reload_fops); } +#endif diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c index 523ba4f6..ed5a8b4e 100644 --- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c @@ -11,13 +11,11 @@ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. */ +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include diff --git a/drivers/gpu/nvgpu/gk20a/clk_gk20a.c b/drivers/gpu/nvgpu/gk20a/clk_gk20a.c index b69f74b2..e904be49 100644 --- a/drivers/gpu/nvgpu/gk20a/clk_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/clk_gk20a.c @@ -18,7 +18,9 @@ #include #include +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include "gk20a.h" diff --git a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c index 94f07701..f3b54355 100644 --- a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h index bb79331c..2f84b0dc 100644 --- a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -24,7 +24,7 @@ struct channel_ctx_gk20a; struct gk20a_ctxsw_dev; struct gk20a_fecs_trace; struct tsg_gk20a; - +struct poll_table_struct; int gk20a_ctxsw_dev_release(struct inode *inode, struct file *filp); int gk20a_ctxsw_dev_open(struct inode *inode, struct file *filp); diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c index 1a9ffe77..d577c625 100644 --- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c @@ -12,9 +12,12 @@ * */ +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include +#include #include #include @@ -298,8 +301,8 @@ int gk20a_railgating_debugfs_init(struct device *dev) void gk20a_debug_init(struct device *dev, const char *debugfs_symlink) { - struct gk20a_platform *platform = dev_get_drvdata(dev); #ifdef CONFIG_DEBUG_FS + struct gk20a_platform *platform = dev_get_drvdata(dev); struct gk20a *g = platform->g; platform->debugfs = debugfs_create_dir(dev_name(dev), NULL); diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c index 7d509a4a..9e78c843 100644 --- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c @@ -13,7 +13,9 @@ #include #include +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c index c886101c..92698745 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index a1700ebf..7c8b4eae 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -35,6 +35,9 @@ struct dbg_profiler_object_data; #include #include #include +#ifdef CONFIG_DEBUG_FS +#include +#endif #include "../../../arch/arm/mach-tegra/iomap.h" @@ -150,7 +153,9 @@ struct gpu_ops { struct zbc_entry *s_val, u32 index); void (*init_cbc)(struct gk20a *g, struct gr_gk20a *gr); +#ifdef CONFIG_DEBUG_FS void (*sync_debugfs)(struct gk20a *g); +#endif void (*init_fs_state)(struct gk20a *g); void (*isr)(struct gk20a *g); u32 (*cbc_fix_config)(struct gk20a *g, int base); @@ -669,7 +674,9 @@ struct gpu_ops { struct { int (*init_therm_setup_hw)(struct gk20a *g); int (*elcg_init_idle_filters)(struct gk20a *g); +#ifdef CONFIG_DEBUG_FS void (*therm_debugfs_init)(struct gk20a *g); +#endif int (*get_internal_sensor_curr_temp)(struct gk20a *g, u32 *temp_f24_8); void (*get_internal_sensor_limits)(s32 *max_24_8, s32 *min_24_8); @@ -1140,7 +1147,9 @@ struct gk20a { u32 tpc_fs_mask_user; struct nvgpu_bios bios; +#ifdef CONFIG_DEBUG_FS struct debugfs_blob_wrapper bios_blob; +#endif struct nvgpu_clk_arb *clk_arb; diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index 06c73b90..8c7a9d80 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c @@ -17,7 +17,6 @@ */ #include -#include #include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 229d5b4f..98513511 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -17,7 +17,9 @@ */ #include +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include diff --git a/drivers/gpu/nvgpu/gk20a/sched_gk20a.c b/drivers/gpu/nvgpu/gk20a/sched_gk20a.c index ff038b62..54091014 100644 --- a/drivers/gpu/nvgpu/gk20a/sched_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/sched_gk20a.c @@ -13,7 +13,9 @@ #include #include +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/sched_gk20a.h b/drivers/gpu/nvgpu/gk20a/sched_gk20a.h index 1f983678..4f6d1510 100644 --- a/drivers/gpu/nvgpu/gk20a/sched_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/sched_gk20a.h @@ -17,6 +17,7 @@ struct gk20a; struct gpu_ops; struct tsg_gk20a; +struct poll_table_struct; struct gk20a_sched_ctrl { struct gk20a *g; diff --git a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c index 0d2f1281..b700c735 100644 --- a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c @@ -1,9 +1,7 @@ /* - * drivers/video/tegra/host/gk20a/therm_gk20a.c - * * GK20A Therm * - * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -14,9 +12,8 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #include "gk20a.h" @@ -105,8 +102,10 @@ int gk20a_init_therm_support(struct gk20a *g) if (err) return err; +#ifdef CONFIG_DEBUG_FS if (g->ops.therm.therm_debugfs_init) g->ops.therm.therm_debugfs_init(g); +#endif return err; } -- cgit v1.2.2