power: qpnp-smb5: Fix Initialize mutex for PD typec designs

Dump stack is observed when mutex (typec_lock) is locked without
initializing it in case of PD supported typec designs. Fix it by
initializing the mutex for PD supported typec designs also.

Change-Id: I7ee29715651dc001a450d80c49c6cce10f10e837
Signed-off-by: Shyam Kumar Thella <sthella@codeaurora.org>
This commit is contained in:
Shyam Kumar Thella 2020-08-18 11:05:20 +05:30 • committed by Gerrit - the friendly Code Review server
commit 8d77be5b92

View file

@ -3490,11 +3490,12 @@ static int smb5_init_typec_class(struct smb5 *chip)
struct smb_charger *chg = &chip->chg;
int rc = 0;
mutex_init(&chg->typec_lock);
/* Register typec class for only non-PD TypeC and uUSB designs */
if (!chg->pd_not_supported)
return rc;
mutex_init(&chg->typec_lock);
chg->typec_caps.type = TYPEC_PORT_DRP;
chg->typec_caps.data = TYPEC_PORT_DRD;
chg->typec_partner_desc.usb_pd = false;