mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
ASoC: wcd-mbhc: Check if mutex is locked before mutex destroy
Mutex destroy is called as part of wcd_mbhc_deinit during SSR for hph pa lock when lock is taken resulting in warning. Check if mutex is locked and unlock mutex before destroy so as to remove warning. Change-Id: I521903f9ab24222278d6fb3f349da18c98131c60 Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
This commit is contained in:
parent
fc2cd3b04f
commit
b83f8c4c43
1 changed files with 9 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
|
|
@ -328,7 +328,8 @@ out_micb_en:
|
|||
else
|
||||
/* Disable micbias, pullup & enable cs */
|
||||
wcd_enable_curr_micbias(mbhc, WCD_MBHC_EN_CS);
|
||||
mutex_unlock(&mbhc->hphl_pa_lock);
|
||||
if (mutex_is_locked(&mbhc->hphl_pa_lock))
|
||||
mutex_unlock(&mbhc->hphl_pa_lock);
|
||||
clear_bit(WCD_MBHC_ANC0_OFF_ACK, &mbhc->hph_anc_state);
|
||||
break;
|
||||
case WCD_EVENT_PRE_HPHR_PA_OFF:
|
||||
|
|
@ -348,7 +349,8 @@ out_micb_en:
|
|||
else
|
||||
/* Disable micbias, pullup & enable cs */
|
||||
wcd_enable_curr_micbias(mbhc, WCD_MBHC_EN_CS);
|
||||
mutex_unlock(&mbhc->hphr_pa_lock);
|
||||
if (mutex_is_locked(&mbhc->hphr_pa_lock))
|
||||
mutex_unlock(&mbhc->hphr_pa_lock);
|
||||
clear_bit(WCD_MBHC_ANC1_OFF_ACK, &mbhc->hph_anc_state);
|
||||
break;
|
||||
case WCD_EVENT_PRE_HPHL_PA_ON:
|
||||
|
|
@ -2067,6 +2069,10 @@ void wcd_mbhc_deinit(struct wcd_mbhc *mbhc)
|
|||
WCD_MBHC_RSC_UNLOCK(mbhc);
|
||||
}
|
||||
mutex_destroy(&mbhc->codec_resource_lock);
|
||||
if (mutex_is_locked(&mbhc->hphl_pa_lock))
|
||||
mutex_unlock(&mbhc->hphl_pa_lock);
|
||||
if (mutex_is_locked(&mbhc->hphr_pa_lock))
|
||||
mutex_unlock(&mbhc->hphr_pa_lock);
|
||||
mutex_destroy(&mbhc->hphl_pa_lock);
|
||||
mutex_destroy(&mbhc->hphr_pa_lock);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue