Thread (11 messages) 11 messages, 2 authors, 2017-08-02

Re: [PATCH v2 9/9] wil6210: make debugfs compilation optional

flat view

From: Arend van Spriel <arend.vanspriel@broadcom.com>
Date: 2017-08-02 21:43:22

On 02-08-17 23:00, Maya Erez wrote:
quoted hunk ↗ jump to hunk
From: Gidon Studinski <redacted>

Since debugfs is a kernel configuration option, enable the driver to
compile without debugfs.

Signed-off-by: Gidon Studinski <redacted>
Signed-off-by: Maya Erez <redacted>
---
 drivers/net/wireless/ath/wil6210/debugfs.c | 14 ++++++++++----
 drivers/net/wireless/ath/wil6210/main.c    |  1 +
 drivers/net/wireless/ath/wil6210/txrx.c    |  6 +++---
 drivers/net/wireless/ath/wil6210/wil6210.h |  2 +-
 4 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index d4e8865..5e803e2 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -14,6 +14,10 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include "wil6210.h"
+
+#ifdef CONFIG_DEBUG_FS
+
[...]
quoted hunk ↗ jump to hunk
+#else /* !CONFIG_DEBUG_FS */
+int wil6210_debugfs_init(struct wil6210_priv *wil) { return 0; }
+void wil6210_debugfs_remove(struct wil6210_priv *wil) {}
+#endif
I think it would be better to have these stubs defined in the header
file, ie. in wil6210.h. That way you can conditionally compile this
source file through Makefile as below keeping debugfs.c clean.

Regards,
Arend
diff --git a/drivers/net/wireless/ath/wil6210/Makefile
b/drivers/net/wireless/ath/wil6210/Makefile
index 4ae21da..0f98904c 100644
--- a/drivers/net/wireless/ath/wil6210/Makefile
+++ b/drivers/net/wireless/ath/wil6210/Makefile
@@ -4,7 +4,7 @@ wil6210-y := main.o
 wil6210-y += netdev.o
 wil6210-y += cfg80211.o
 wil6210-y += pcie_bus.o
-wil6210-y += debugfs.o
+wil6210-$(CONFIG_DEBUG_FS) += debugfs.o
 wil6210-y += wmi.o
 wil6210-y += interrupt.o
 wil6210-y += txrx.o
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help