From cfb067b6d7e28a1d202f6efe437c080f474d81dd Mon Sep 17 00:00:00 2001 From: David Pu Date: Sat, 18 Jun 2016 02:01:11 -0700 Subject: gpu: nvgpu: fix issue with CONFIG_DEBUG_FS=n following compilation error are reported with CONFIG_DEBUG_FS=n: pci.c:246:7: error: 'struct mm_gk20a' has no member named 'ltc_enabled' pci.c:247:7: error: 'struct mm_gk20a' has no member named 'ltc_enabled_debug' possible compilation error(reported sometime): gk20a_allocator.c:1163:13: error: 'gk20a_alloc_debugfs_init' defined but not used fixed by adding '#ifdef CONFIG_DEBUG_FS' for debug only code. following variables from gk20a.c are not initialized from CONFIG_DEBUG_FS=n path, it will cause kernel oops when booting: gk20a->mm.bypass_smmu = platform->bypass_smmu; gk20a->mm.disable_bigpage = platform->disable_bigpage; gk20a->mm.has_physical_mode = true; fix it by move them out from '#ifdef CONFIG_DEBUG_FS' section. Bug 1778001 Change-Id: Ic2da36b3f500882748ee46a5150903244b697761 Signed-off-by: David Pu Reviewed-on: http://git-master/r/1167358 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a_allocator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_allocator.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c index a7378956..2b351492 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c @@ -1,7 +1,7 @@ /* * gk20a allocator * - * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2016, 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, @@ -1160,6 +1160,7 @@ static void balloc_init_alloc_debug(struct gk20a_allocator *a) a, &__alloc_fops); } +#ifdef CONFIG_DEBUG_FS void gk20a_alloc_debugfs_init(struct platform_device *pdev) { struct gk20a_platform *platform = platform_get_drvdata(pdev); @@ -1172,3 +1173,4 @@ void gk20a_alloc_debugfs_init(struct platform_device *pdev) debugfs_create_u32("tracing", 0664, balloc_debugfs_root, &balloc_tracing_on); } +#endif -- cgit v1.2.2