driver
driver copied to clipboard
Fix debug flag
Hello,
please remove debug output as default parameter. As second part of patch small fix: if debug is disabled function wilc_debugfs_init and wilc_debugfs_remove are not available in wilc_wfi_cfgoperations.
Best Regards
diff --git a/wilc/Makefile b/wilc/Makefile
index 7eb8cf0..5891dfc 100644
--- a/wilc/Makefile
+++ b/wilc/Makefile
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
-ccflags-y += -I$(src)/ -DWILC_ASIC_A0 -DWILC_DEBUGFS
+ccflags-y += -I$(src)/ -DWILC_ASIC_A0
wilc-objs := wilc_wfi_cfgoperations.o wilc_netdev.o wilc_mon.o \
wilc_hif.o wilc_wlan_cfg.o wilc_debugfs.o \
diff --git a/wilc/wilc_wfi_cfgoperations.c b/wilc/wilc_wfi_cfgoperations.c
index 4553637..94c197d 100644
--- a/wilc/wilc_wfi_cfgoperations.c
+++ b/wilc/wilc_wfi_cfgoperations.c
@@ -2390,8 +2390,9 @@ int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type,
ret = cfg_init(wl);
if (ret)
goto free_wl;
-
+#if defined(WILC_DEBUGFS)
wilc_debugfs_init();
+#endif
*wilc = wl;
wl->io_type = io_type;
wl->hif_func = ops;
@@ -2419,7 +2420,9 @@ int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type,
free_wq:
destroy_workqueue(wl->hif_workqueue);
free_debug_fs:
+#if defined(WILC_DEBUGFS)
wilc_debugfs_remove();
+#endif
cfg_deinit(wl);
free_wl:
wlan_deinit_locks(wl);
yes, correct the use of wilc_debugfs_init()/wilc_debugfs_remove() call should be under the macro definition. However, WILC_DEBUGFS should be defined by default so that enough information is captured during the test. Anyway, if anyone wants to disable WILC_DEBUGFS , it can be done locally.