linux4wilc / driver

DEPRECATED: Updated Linux drivers for the ATWILC1000/ATWILC3000 products are located at https://github.com/linux4microchip/linux/tree/master/drivers/net/wireless/microchip/wilc1000. To simplify development, the legacy Linux4WILC was merged into the Linux4Microchip repo where driver development continues (Please refer latest ATWILC1000/ATWILC 3000 Wi-Fi Link Controller Linux User Guide) Driver code for Microchip ATWILC Wireless Devices (ATWILC1000 & ATWILC3000)
https://www.microchip.com/wwwproducts/en/ATWILC1000
32 stars 20 forks source link

Fix debug flag #97

Open rom-dim opened 4 years ago

rom-dim commented 4 years ago

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);
ajaykathat commented 4 years ago

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.