From 3a2801280574108475503ebd64fbb960bb060eba Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 13 Sep 2017 07:42:00 -0700 Subject: [PATCH] qcacld-3.0: Remove cds_context param to cds_pre_enable() Currently cds_pre_enable() takes a cds_context param. However CDS already maintains its own context, hence this param introduces an unnecessary coupling, so remove it. Change-Id: I5a33859583ea4245c79daf42addd62ecedfd11df CRs-Fixed: 2109242 --- core/cds/inc/cds_api.h | 2 +- core/cds/src/cds_api.c | 22 ++++++++++++++-------- core/hdd/src/wlan_hdd_main.c | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index a9401b6ad2c4..873160edd8d4 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -309,7 +309,7 @@ static inline bool cds_is_driver_loaded(void) v_CONTEXT_t cds_init(void); void cds_deinit(void); -QDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context); +QDF_STATUS cds_pre_enable(void); QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc); diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index d29481ef020f..f7b5a460d82f 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -684,33 +684,32 @@ err_probe_event: /** * cds_pre_enable() - pre enable cds - * @cds_context: CDS context * * Return: QDF status */ -QDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context) +QDF_STATUS cds_pre_enable(void) { QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; - p_cds_contextType p_cds_context = (p_cds_contextType) cds_context; void *scn; - void *soc = cds_get_context(QDF_MODULE_ID_SOC); + void *soc; QDF_TRACE(QDF_MODULE_ID_SYS, QDF_TRACE_LEVEL_DEBUG, "cds prestart"); - if (gp_cds_context != p_cds_context) { + + if (!gp_cds_context) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "%s: Context mismatch", __func__); + "%s: NULL CDS context", __func__); QDF_ASSERT(0); return QDF_STATUS_E_INVAL; } - if (p_cds_context->pMACContext == NULL) { + if (gp_cds_context->pMACContext == NULL) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, "%s: MAC NULL context", __func__); QDF_ASSERT(0); return QDF_STATUS_E_INVAL; } - if (p_cds_context->pWMAContext == NULL) { + if (gp_cds_context->pWMAContext == NULL) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, "%s: WMA NULL context", __func__); QDF_ASSERT(0); @@ -724,6 +723,13 @@ QDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context) return QDF_STATUS_E_FAILURE; } + soc = cds_get_context(QDF_MODULE_ID_SOC); + if (!soc) { + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, + "%s: soc is null!", __func__); + return QDF_STATUS_E_FAILURE; + } + /* call Packetlog connect service */ if (QDF_GLOBAL_FTM_MODE != cds_get_conparam() && QDF_GLOBAL_EPPING_MODE != cds_get_conparam()) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c08265081edc..5d2849d51b65 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2249,7 +2249,7 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, struct hdd_adapter *adap hdd_ctx->hHal = cds_get_context(QDF_MODULE_ID_SME); - status = cds_pre_enable(hdd_ctx->pcds_context); + status = cds_pre_enable(); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("Failed to pre-enable CDS: %d", status); goto close;