From ceb0ecb7668d6b32ead207b8d93a5646dd86ab0b Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Mon, 12 Mar 2018 14:44:00 -0700 Subject: gpu: nvgpu: gp106: Reduce usage of os_linux.h In clk_gp106 the Linux platform specific data is only referenced if debugfs is being used. Thus only include the Linux OS stuff if debugfs is enabled. This allows us to compile the rest of the clk code in non- Linux kernel environments. Also delete os_linux.h from xve_gp106.c since that header is unused in the XVE code (and also do a minor cleanup by deleting the pr_warn()). JIRA NVGPU-525 Signed-off-by: Alex Waterman Change-Id: I5a20ba3b02eb2d8741c73ef2ded9276f6aebb957 Reviewed-on: https://git-master.nvidia.com/r/1687090 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp106/clk_gp106.c | 5 ++--- drivers/gpu/nvgpu/gp106/xve_gp106.c | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c index 2ac2ce5a..9a94a7b9 100644 --- a/drivers/gpu/nvgpu/gp106/clk_gp106.c +++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c @@ -24,17 +24,16 @@ #ifdef CONFIG_DEBUG_FS #include +#include "common/linux/os_linux.h" #endif #include #include "gk20a/gk20a.h" -#include "common/linux/os_linux.h" +#include "gp106/mclk_gp106.h" #include "clk_gp106.h" -#include "gp106/mclk_gp106.h" - #include #define gk20a_dbg_clk(fmt, arg...) \ diff --git a/drivers/gpu/nvgpu/gp106/xve_gp106.c b/drivers/gpu/nvgpu/gp106/xve_gp106.c index ac6684a5..9becd0f2 100644 --- a/drivers/gpu/nvgpu/gp106/xve_gp106.c +++ b/drivers/gpu/nvgpu/gp106/xve_gp106.c @@ -23,7 +23,6 @@ #include "gk20a/gk20a.h" #include "gp106/bios_gp106.h" #include "gp106/xve_gp106.h" -#include "common/linux/os_linux.h" #include #include @@ -108,10 +107,8 @@ int xve_get_speed_gp106(struct gk20a *g, u32 *xve_link_speed) if (link_speed == xve_link_control_status_link_speed_link_speed_8p0_v()) real_link_speed = GPU_XVE_SPEED_8P0; - if (!real_link_speed) { - pr_warn("%s: Unknown PCIe bus speed!\n", __func__); + if (!real_link_speed) return -ENODEV; - } *xve_link_speed = real_link_speed; return 0; -- cgit v1.2.2