From bcd3481965d2032f68b18185796db7acffe35332 Mon Sep 17 00:00:00 2001 From: Prashanth Bhatta Date: Thu, 19 Jan 2017 15:33:43 -0800 Subject: [PATCH] qcacmn: Change semantics of Runtime Lock APIs Runtime PM lock init API right now returns pointer to a context but this would cause confusion to the caller if feature is not defined and dummy function return NULL as caller can't find real failure versus dummy function returning because feature not being enabled. Fix declaring a data structure in QDF layer that caller can use but it hides the internal details of HIF implementation for Runtime PM locks. CRs-fixed: 1116509 Change-Id: I4dcba604e803faa0e14fac6403610391895e382e --- core/src/wlan_p2p_main.c | 6 +++--- core/src/wlan_p2p_roc.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/wlan_p2p_main.c b/core/src/wlan_p2p_main.c index bce6afc5fe1a..3d68b43cec97 100644 --- a/core/src/wlan_p2p_main.c +++ b/core/src/wlan_p2p_main.c @@ -663,8 +663,8 @@ QDF_STATUS p2p_psoc_object_open(struct wlan_objmgr_psoc *soc) p2p_err("failed to create cancel roc done event"); goto fail_event; } - p2p_soc_obj->roc_runtime_lock = qdf_runtime_lock_init( - P2P_MODULE_NAME); + + qdf_runtime_lock_init(&p2p_soc_obj->roc_runtime_lock); p2p_debug("p2p psoc object open successful"); @@ -694,7 +694,7 @@ QDF_STATUS p2p_psoc_object_close(struct wlan_objmgr_psoc *soc) return QDF_STATUS_E_FAILURE; } - qdf_runtime_lock_deinit(p2p_soc_obj->roc_runtime_lock); + qdf_runtime_lock_deinit(&p2p_soc_obj->roc_runtime_lock); qdf_event_destroy(&p2p_soc_obj->cancel_roc_done); qdf_list_destroy(&p2p_soc_obj->tx_q_ack); qdf_list_destroy(&p2p_soc_obj->tx_q_roc); diff --git a/core/src/wlan_p2p_roc.c b/core/src/wlan_p2p_roc.c index e83914d1c300..6456b723ad17 100644 --- a/core/src/wlan_p2p_roc.c +++ b/core/src/wlan_p2p_roc.c @@ -345,7 +345,7 @@ static QDF_STATUS p2p_execute_roc_req(struct p2p_roc_context *roc_ctx) roc_ctx->roc_type, roc_ctx->roc_state); /* prevent runtime suspend */ - qdf_runtime_pm_prevent_suspend(p2p_soc_obj->roc_runtime_lock); + qdf_runtime_pm_prevent_suspend(&p2p_soc_obj->roc_runtime_lock); status = qdf_mc_timer_init(&roc_ctx->roc_timer, QDF_TIMER_TYPE_SW, p2p_roc_timeout, @@ -375,7 +375,7 @@ fail: if (status != QDF_STATUS_SUCCESS) { p2p_destroy_roc_ctx(roc_ctx, true, true); qdf_runtime_pm_allow_suspend( - p2p_soc_obj->roc_runtime_lock); + &p2p_soc_obj->roc_runtime_lock); return status; } @@ -501,7 +501,7 @@ static QDF_STATUS p2p_process_scan_complete_evt( roc_ctx->roc_type, roc_ctx->roc_state); /* allow runtime suspend */ - qdf_runtime_pm_allow_suspend(p2p_soc_obj->roc_runtime_lock); + qdf_runtime_pm_allow_suspend(&p2p_soc_obj->roc_runtime_lock); if (QDF_TIMER_STATE_RUNNING == qdf_mc_timer_get_current_state(&roc_ctx->roc_timer)) {