From 764c42be075edc624e893330b05bea87db111142 Mon Sep 17 00:00:00 2001 From: Armaan Siddiqui Date: Tue, 25 Feb 2020 18:26:25 +0530 Subject: [PATCH] msm: ipa: Fix compilation issues when DEBUG_FS is disabled Adding changes to fix compiltaion errors when flag CONFIG_DEBUG_FS is disabled. Change-Id: Ib27c1ee1f883221f7cf240344b16d32219fd585c Signed-off-by: Armaan Siddiqui Signed-off-by: Prakruthi Deepak Heragu --- drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c | 9 ++++++--- .../platform/msm/ipa/ipa_clients/ipa_mhi_client.c | 14 ++++++++------ drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c | 9 +++++++++ drivers/platform/msm/ipa/test/ipa_ut_framework.c | 2 ++ 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c b/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c index 5c1522819343..04dd7b206128 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. */ #include @@ -55,15 +55,18 @@ } while (0) #define IPA_GSB_MAX_MSG_LEN 512 + +#ifdef CONFIG_DEBUG_FS +static struct dentry *dent; +static struct dentry *dfile_stats; static char dbg_buff[IPA_GSB_MAX_MSG_LEN]; +#endif #define IPA_GSB_SKB_HEADROOM 256 #define IPA_GSB_SKB_DUMMY_HEADER 42 #define IPA_GSB_AGGR_BYTE_LIMIT 14 #define IPA_GSB_AGGR_TIME_LIMIT 1000 /* 1000 us */ -static struct dentry *dent; -static struct dentry *dfile_stats; /** * struct stats - driver statistics, diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c b/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c index 483b02bd3874..0a2e9b608642 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. */ #include @@ -147,11 +147,6 @@ struct ipa_mhi_client_ctx { static struct ipa_mhi_client_ctx *ipa_mhi_client_ctx; static DEFINE_MUTEX(mhi_client_general_mutex); -#ifdef CONFIG_DEBUG_FS -#define IPA_MHI_MAX_MSG_LEN 512 -static char dbg_buff[IPA_MHI_MAX_MSG_LEN]; -static struct dentry *dent; - static char *ipa_mhi_channel_state_str[] = { __stringify(IPA_HW_MHI_CHANNEL_STATE_DISABLE), __stringify(IPA_HW_MHI_CHANNEL_STATE_ENABLE), @@ -262,6 +257,11 @@ fail_dma_enable: return res; } +#ifdef CONFIG_DEBUG_FS +#define IPA_MHI_MAX_MSG_LEN 512 +static char dbg_buff[IPA_MHI_MAX_MSG_LEN]; +static struct dentry *dent; + static int ipa_mhi_print_channel_info(struct ipa_mhi_channel_ctx *channel, char *buff, int len) { @@ -2186,10 +2186,12 @@ int ipa_mhi_destroy_all_channels(void) return 0; } +#ifdef CONFIG_DEBUG_FS static void ipa_mhi_debugfs_destroy(void) { debugfs_remove_recursive(dent); } +#endif static void ipa_mhi_deregister_pm(void) { diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c b/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c index d5b0923fda67..e106067778c5 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c @@ -3102,6 +3102,15 @@ struct dentry *ipa_debugfs_get_root(void) EXPORT_SYMBOL(ipa_debugfs_get_root); #else /* !CONFIG_DEBUG_FS */ +#define INVALID_NO_OF_CHAR (-1) void ipa3_debugfs_init(void) {} void ipa3_debugfs_remove(void) {} +int _ipa_read_ep_reg_v3_0(char *buf, int max_len, int pipe) +{ + return INVALID_NO_OF_CHAR; +} +int _ipa_read_ep_reg_v4_0(char *buf, int max_len, int pipe) +{ + return INVALID_NO_OF_CHAR; +} #endif diff --git a/drivers/platform/msm/ipa/test/ipa_ut_framework.c b/drivers/platform/msm/ipa/test/ipa_ut_framework.c index f5e076b7aa69..9184a8228843 100644 --- a/drivers/platform/msm/ipa/test/ipa_ut_framework.c +++ b/drivers/platform/msm/ipa/test/ipa_ut_framework.c @@ -922,7 +922,9 @@ static int ipa_ut_framework_init(void) ipa_assert_on(!ipa_ut_ctx); +#ifdef CONFIG_DEBUG_FS ipa_ut_ctx->ipa_dbgfs_root = ipa_debugfs_get_root(); +#endif if (!ipa_ut_ctx->ipa_dbgfs_root) { IPA_UT_ERR("No IPA debugfs root entry\n"); return -EFAULT;