diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index dfa94d7edbe8..7861d76b6d07 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -306,7 +306,17 @@ static inline bool cds_is_driver_loaded(void) return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_LOADED); } -v_CONTEXT_t cds_init(void); +/** + * cds_init() - Initialize CDS + * + * This function allocates the resource required for CDS, but does not + * initialize all the members. This overall initialization will happen at + * cds_open(). + * + * Return: QDF_STATUS_SUCCESS if CDS was initialized and an error on failure + */ +QDF_STATUS cds_init(void); + void cds_deinit(void); QDF_STATUS cds_pre_enable(void); diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 2e39afedada9..47ad885d1032 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -156,16 +156,7 @@ uint8_t cds_get_datapath_handles(void **soc, struct cdp_pdev **pdev, } -/** - * cds_init() - Initialize CDS - * - * This function allocates the resource required for CDS, but does not - * initialize all the members. This overall initialization will happen at - * cds_open(). - * - * Return: Global context on success and NULL on failure. - */ -v_CONTEXT_t cds_init(void) +QDF_STATUS cds_init(void) { qdf_debugfs_init(); qdf_lock_stats_init(); @@ -189,7 +180,7 @@ v_CONTEXT_t cds_init(void) cds_recovery_work_init(); - return gp_cds_context; + return gp_cds_context ? QDF_STATUS_SUCCESS : QDF_STATUS_E_FAILURE; } /** diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index d3e4f65c886a..a5916566f812 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -10948,10 +10948,10 @@ static void hdd_qdf_print_deinit(void) */ int hdd_init(void) { - v_CONTEXT_t p_cds_context = NULL; + QDF_STATUS status; int ret = 0; - p_cds_context = cds_init(); + status = cds_init(); wlan_init_bug_report_lock(); @@ -10959,7 +10959,7 @@ int hdd_init(void) wlan_logging_sock_init_svc(); #endif - if (p_cds_context == NULL) { + if (QDF_IS_STATUS_ERROR(status)) { hdd_err("Failed to allocate CDS context"); ret = -ENOMEM; goto err_out;