From 7b3ddc2a5bbb339431cc14206ee1fc01a0de81f4 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 13 Sep 2017 09:42:44 -0700 Subject: [PATCH] qcacld-3.0: Remove wma_wmi_service_close() cds_ctx parameter Currently wma_wmi_service_close() takes a cds_ctx parameter. All of the other WMA functions which previously took a cds_ctx no longer use that parameter, and those functions have been modified to remove the unused parameter. wma_wmi_service_close() still needs the cds_ctx, but it can get that context by calling cds_get_global_context(), so remove the cds_ctx parameter to be consistent with the other WMA functions. Note: the fact that wma_wmi_service_close() needs the cds_ctx, and then dereferences it, is a layering violation that needs to be addressed in the future. Change-Id: I02564bae87077314fea58c1509b3a50b8d567a7a CRs-Fixed: 2109262 --- core/cds/src/cds_api.c | 4 ++-- core/wma/inc/wma_api.h | 2 +- core/wma/src/wma_main.c | 10 ++++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 3f2efd895e03..2410a8af8aa0 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -650,7 +650,7 @@ err_mac_close: err_wma_close: cds_shutdown_notifier_purge(); wma_close(); - wma_wmi_service_close(gp_cds_context); + wma_wmi_service_close(); pmo_ucfg_psoc_update_dp_handle(psoc, NULL); err_htc_close: @@ -1131,7 +1131,7 @@ QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc, v_CONTEXT_t cds_context) } } - qdf_status = wma_wmi_service_close(cds_context); + qdf_status = wma_wmi_service_close(); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, "%s: Failed to close wma_wmi_service", __func__); diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index ae6b0e940ccc..fcc1eea18998 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -104,7 +104,7 @@ QDF_STATUS wma_stop(uint8_t reason); QDF_STATUS wma_close(void); -QDF_STATUS wma_wmi_service_close(void *cds_context); +QDF_STATUS wma_wmi_service_close(void); QDF_STATUS wma_wmi_work_close(void); diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 6de9221d28eb..bbcdff337947 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -3531,18 +3531,24 @@ end: /** * wma_wmi_service_close() - close wma wmi service interface. - * @cds_ctx: cds context * * Return: 0 on success, QDF Error on failure */ -QDF_STATUS wma_wmi_service_close(void *cds_ctx) +QDF_STATUS wma_wmi_service_close(void) { + void *cds_ctx; tp_wma_handle wma_handle; struct beacon_info *bcn; int i; WMA_LOGD("%s: Enter", __func__); + cds_ctx = cds_get_global_context(); + if (!cds_ctx) { + WMA_LOGE("%s: Invalid CDS context", __func__); + return QDF_STATUS_E_INVAL; + } + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); /* validate the wma_handle */