From edd12697e4e77b0089d4d0318d6bd12f146db386 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Mon, 22 Oct 2018 09:43:25 -0700 Subject: [PATCH] qcacmn: Return success when debugfs is disabled Currently, the QDF debugfs feature returns a no-support error code for the init call when the feature is compiled out. Instead, return success to avoid wlan load failure on some configurations and to make error checking by the caller more straight forward under all configurations. The deinit call also has the same problem, but none of the callers pay attention to the return status. Additionally, the deinit function returns success unconditionally when the feature is compiled in. Rather than changing the return status to success when the feature is compiled out, change the return type of the deinit function to void. Change-Id: Iac3a47505142e149f70c67c5ba6cf0b2428d9488 CRs-Fixed: 2336872 --- qdf/inc/qdf_debugfs.h | 11 ++++------- qdf/linux/src/qdf_debugfs.c | 6 ++---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/qdf/inc/qdf_debugfs.h b/qdf/inc/qdf_debugfs.h index b4e965ccd8..62200b30fd 100644 --- a/qdf/inc/qdf_debugfs.h +++ b/qdf/inc/qdf_debugfs.h @@ -70,9 +70,9 @@ QDF_STATUS qdf_debugfs_init(void); /** * qdf_debugfs_exit() - cleanup debugfs * - * Return: QDF_STATUS + * Return: None */ -QDF_STATUS qdf_debugfs_exit(void); +void qdf_debugfs_exit(void); /** * qdf_debugfs_create_dir() - create a debugfs directory @@ -244,13 +244,10 @@ void qdf_debugfs_remove_file(qdf_dentry_t d); static inline QDF_STATUS qdf_debugfs_init(void) { - return QDF_STATUS_E_NOSUPPORT; + return QDF_STATUS_SUCCESS; } -static inline QDF_STATUS qdf_debugfs_exit(void) -{ - return QDF_STATUS_E_NOSUPPORT; -} +static inline void qdf_debugfs_exit(void) { } static inline qdf_dentry_t qdf_debugfs_create_dir(const char *name, qdf_dentry_t parent) diff --git a/qdf/linux/src/qdf_debugfs.c b/qdf/linux/src/qdf_debugfs.c index 66664a9627..57895d1da0 100644 --- a/qdf/linux/src/qdf_debugfs.c +++ b/qdf/linux/src/qdf_debugfs.c @@ -46,15 +46,13 @@ QDF_STATUS qdf_debugfs_init(void) } qdf_export_symbol(qdf_debugfs_init); -QDF_STATUS qdf_debugfs_exit(void) +void qdf_debugfs_exit(void) { if (!qdf_debugfs_root) - return QDF_STATUS_SUCCESS; + return; debugfs_remove_recursive(qdf_debugfs_root); qdf_debugfs_root = NULL; - - return QDF_STATUS_SUCCESS; } qdf_export_symbol(qdf_debugfs_exit);