From 035c50b0bd5dcaac6a5f2da4dc91e360636c57c1 Mon Sep 17 00:00:00 2001 From: Karthikeyan Mani Date: Thu, 2 May 2019 13:35:01 -0700 Subject: [PATCH] soundwire: return error if vote for LPASS HW Core fails Before proceeding with handling soundwire interrupt check return value of vote for LPASS HW core and handle error scenarios. Change-Id: I0f19a5ddb0af82f33a8d004d008eda9baa40c036 Signed-off-by: Karthikeyan Mani --- soc/swr-mstr-ctrl.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/soc/swr-mstr-ctrl.c b/soc/swr-mstr-ctrl.c index bddf30a4e882..bb3449467263 100644 --- a/soc/swr-mstr-ctrl.c +++ b/soc/swr-mstr-ctrl.c @@ -1441,8 +1441,15 @@ static irqreturn_t swr_mstr_interrupt_v2(int irq, void *dev) } mutex_lock(&swrm->reslock); - if (swrm->lpass_core_hw_vote) - clk_prepare_enable(swrm->lpass_core_hw_vote); + if (swrm->lpass_core_hw_vote) { + ret = clk_prepare_enable(swrm->lpass_core_hw_vote); + if (ret < 0) { + dev_err(dev, "%s:lpass core hw enable failed\n", + __func__); + ret = IRQ_NONE; + goto exit; + } + } swrm_clk_request(swrm, true); mutex_unlock(&swrm->reslock); @@ -1612,6 +1619,7 @@ static irqreturn_t swr_mstr_interrupt_v2(int irq, void *dev) swrm_clk_request(swrm, false); if (swrm->lpass_core_hw_vote) clk_disable_unprepare(swrm->lpass_core_hw_vote); +exit: mutex_unlock(&swrm->reslock); swrm_unlock_sleep(swrm); return ret;