From e501f2c62fea87813f70209d1340f5702f013045 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Mon, 26 Jun 2017 14:37:07 -0700 Subject: [PATCH] qcacmn: Create WMI debugfs only if WLAN_DEBUGFS is defined WMI FW log debug FS is created irrespective of WLAN_DEBUGFS is defined or not. Make sure to only create WMI log debugfs only if WLAN_DEBUGFS is defined. Change-Id: I8d7d5ef160ce2674b3f01dc7afa3ac4761538cab CRs-Fixed: 2066664 --- utils/fwlog/dbglog_host.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/utils/fwlog/dbglog_host.c b/utils/fwlog/dbglog_host.c index db50962fec61..e35c9a50f237 100644 --- a/utils/fwlog/dbglog_host.c +++ b/utils/fwlog/dbglog_host.c @@ -4091,25 +4091,41 @@ static const struct file_operations fops_dbglog_block = { .llseek = default_llseek, }; -static int dbglog_debugfs_init(wmi_unified_t wmi_handle) +#ifdef WLAN_DEBUGFS + +static void dbglog_debugfs_init(wmi_unified_t wmi_handle) { wmi_handle->debugfs_phy = debugfs_create_dir(CLD_DEBUGFS_DIR, NULL); - if (!wmi_handle->debugfs_phy) - return -ENOMEM; + if (!wmi_handle->debugfs_phy) { + qdf_print("Failed to create WMI debug fs"); + return; + } debugfs_create_file(DEBUGFS_BLOCK_NAME, S_IRUSR, wmi_handle->debugfs_phy, &wmi_handle->dbglog, &fops_dbglog_block); - return true; + return; } -static int dbglog_debugfs_remove(wmi_unified_t wmi_handle) +static void dbglog_debugfs_remove(wmi_unified_t wmi_handle) { debugfs_remove_recursive(wmi_handle->debugfs_phy); - return true; } + +#else + +static void dbglog_debugfs_init(wmi_unified_t wmi_handle) +{ +} + +static void dbglog_debugfs_remove(wmi_unified_t wmi_handle) +{ +} + +#endif /* End of WLAN_DEBUGFS */ + #endif /* WLAN_OPEN_SOURCE */ /**