Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ec0660b authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati
Browse files

ASoC: wcd9xxx: Do not acquire codec resource lock to get hph impedance



Acquiring codec resource lock within get impedance function may
cause deadlock when headset inserted/removed repeatedly. Remove
the lock as it is not required to be protected with a mutex.

CRs-fixed: 597226
Change-Id: I20865e0b2bb193f2f8777f2b69e735a0d4997cca
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
parent f75c756e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -4746,10 +4746,8 @@ static int wcd9xxx_detect_impedance(struct wcd9xxx_mbhc *mbhc, uint32_t *zl,
int wcd9xxx_mbhc_get_impedance(struct wcd9xxx_mbhc *mbhc, uint32_t *zl,
			       uint32_t *zr)
{
	WCD9XXX_BCL_LOCK(mbhc->resmgr);
	*zl = mbhc->zl;
	*zr = mbhc->zr;
	WCD9XXX_BCL_UNLOCK(mbhc->resmgr);

	if (*zl && *zr)
		return 0;