summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMagnus Templing <magnus.templing@stericsson.com>2011-11-14 16:34:53 +0100
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:05:00 +0200
commit4bd9f09e34e09b594843958326e10c4047b33b3c (patch)
tree6cbc0c3c40292ebe14605fec14385371ff79006d /sound
parent7af09eaf3a892dd397b34494f9f4d435b4dab211 (diff)
Ux500 ASoC: power_lock was not properly released
ST-Ericsson ID: 373275 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Signed-off-by: Magnus Templing <magnus.templing@stericsson.com> Change-Id: I13837da43f8083ce4e0fb361f21a8e7fa8a14970 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/37689 Reviewed-by: QATOOLS Reviewed-by: QABUILD Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Ola LILJA2 <ola.o.lilja@stericsson.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/ux500/ux500_ab8500.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sound/soc/ux500/ux500_ab8500.c b/sound/soc/ux500/ux500_ab8500.c
index 34c6aa0eef4..f9234c6c721 100644
--- a/sound/soc/ux500/ux500_ab8500.c
+++ b/sound/soc/ux500/ux500_ab8500.c
@@ -178,7 +178,7 @@ err_get:
static int ux500_ab8500_power_control_inc(void)
{
- int ret;
+ int ret = 0;
mutex_lock(&power_lock);
@@ -192,6 +192,9 @@ static int ux500_ab8500_power_control_inc(void)
/* Turn on audio-regulator */
ret = enable_regulator(REGULATOR_AUDIO);
+ if (ret)
+ goto out;
+
/* Enable audio-clock */
ret = clk_set_parent(clk_ptr_intclk,
(master_clock_sel == 0) ? clk_ptr_sysclk : clk_ptr_ulpclk);
@@ -200,7 +203,7 @@ static int ux500_ab8500_power_control_inc(void)
__func__,
(master_clock_sel == 0) ? "SYSCLK" : "ULPCLK",
ret);
- return ret;
+ goto clk_err;
}
pr_debug("%s: Enabling master-clock (%s).",
__func__,
@@ -209,16 +212,20 @@ static int ux500_ab8500_power_control_inc(void)
if (ret) {
pr_err("%s: ERROR: clk_enable failed (ret = %d)!", __func__, ret);
ab8500_power_count = 0;
- return ret;
+ goto clk_err;
}
/* Power on audio-parts of AB8500 */
ab8500_audio_power_control(true);
}
+clk_err:
+ disable_regulator(REGULATOR_AUDIO);
+
+out:
mutex_unlock(&power_lock);
- return 0;
+ return ret;
}
static void ux500_ab8500_power_control_dec(void)