On 02-08-17 23:00, Maya Erez wrote:
> From: Gidon Studinski <qca_gid...@qca.qualcomm.com>
> 
> Since debugfs is a kernel configuration option, enable the driver to
> compile without debugfs.
> 
> Signed-off-by: Gidon Studinski <qca_gid...@qca.qualcomm.com>
> Signed-off-by: Maya Erez <qca_me...@qca.qualcomm.com>
> ---
>  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
> +

[...]

> +#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

Reply via email to