Browse Source

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
Jeff Johnson 7 years ago
parent
commit
7b3ddc2a5b
3 changed files with 11 additions and 5 deletions
  1. 2 2
      core/cds/src/cds_api.c
  2. 1 1
      core/wma/inc/wma_api.h
  3. 8 2
      core/wma/src/wma_main.c

+ 2 - 2
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__);

+ 1 - 1
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);
 

+ 8 - 2
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 */