From 46f2e79cea40dc4b319cdbc39c33eec982b7728e Mon Sep 17 00:00:00 2001 From: Phani Kumar Uppalapati Date: Tue, 3 Dec 2013 15:24:32 -0800 Subject: [PATCH] ASoC: msm: qdsp6v2: Fix APR de-register issues during session close APR de-register should get called for all open streams. The change handles a case where de-register is not called. CRs-fixed: 584533 Change-Id: Ied50b68cdf675583e1451954f7ddf40e9c4f53df Signed-off-by: Phani Kumar Uppalapati --- sound/soc/msm/qdsp6v2/q6asm.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sound/soc/msm/qdsp6v2/q6asm.c b/sound/soc/msm/qdsp6v2/q6asm.c index 2804c6aa9ab..7355e52ab0b 100644 --- a/sound/soc/msm/qdsp6v2/q6asm.c +++ b/sound/soc/msm/qdsp6v2/q6asm.c @@ -731,6 +731,8 @@ void q6asm_audio_client_free(struct audio_client *ac) } } + apr_deregister(ac->apr2); + ac->apr2 = NULL; apr_deregister(ac->apr); ac->apr = NULL; ac->mmap_apr = NULL; @@ -811,13 +813,18 @@ struct audio_client *q6asm_audio_client_alloc(app_cb cb, void *priv) (apr_fn)q6asm_callback,\ ((ac->session) << 8 | 0x0001),\ ac); + + if (ac->apr == NULL) { + pr_err("%s Registration with APR failed\n", __func__); + goto fail; + } ac->apr2 = apr_register("ADSP", "ASM", \ (apr_fn)q6asm_callback,\ ((ac->session) << 8 | 0x0002),\ ac); - if (ac->apr == NULL) { - pr_err("%s Registration with APR failed\n", __func__); + if (ac->apr2 == NULL) { + pr_err("%s Registration with APR-2 failed\n", __func__); goto fail; } rtac_set_asm_handle(n, ac->apr);