msm: audio: qdsp6v2: Close smd ports upon failure to open.
The smd port acqusition is failing as the port is not
populated from modem . But apr driver was not releasing
the apr handle on failure.
This was resulting in failure for subsequent calls.
With this change, the smd ports will be released upon
encountering failure.
CRs-fixed: 309413
Signed-off-by: Bharath Ramachandramurthy <bramacha@codeaurora.org>
diff --git a/arch/arm/mach-msm/qdsp6v2/apr_tal.c b/arch/arm/mach-msm/qdsp6v2/apr_tal.c
index 418da4d..03f0513 100644
--- a/arch/arm/mach-msm/qdsp6v2/apr_tal.c
+++ b/arch/arm/mach-msm/qdsp6v2/apr_tal.c
@@ -165,7 +165,7 @@
apr_svc_ch[dl][dest][svc].dest_state,
msecs_to_jiffies(APR_OPEN_TIMEOUT_MS));
if (rc == 0) {
- pr_debug("apr_tal:Open timeout\n");
+ pr_err("apr_tal:open timeout\n");
mutex_unlock(&apr_svc_ch[dl][dest][svc].m_lock);
return NULL;
}
@@ -187,6 +187,7 @@
if (rc == 0) {
pr_err("apr_tal:TIMEOUT for OPEN event\n");
mutex_unlock(&apr_svc_ch[dl][dest][svc].m_lock);
+ apr_tal_close(&apr_svc_ch[dl][dest][svc]);
return NULL;
}
if (!apr_svc_ch[dl][dest][svc].dest_state) {