Skip to contentSkip to conversation

ASoC: rt5665: Unlock on error in rt5665_calibrate()

PATCH In review Dan Carpenter 2 participants 2 messages Nov 18, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: rt5665: Unlock on error in rt5665_calibrate()

We should probably unlock before returning here.

Fixes 33ada14a26c8 ("ASoC: add rt5665 codec driver")
sound/soc/codecs/rt5665.c +3 -3
index 34254fd..25bd01b 100644
@@ -4587,7 +4587,7 @@ static void rt5665_calibrate(struct rt5665_priv *rt5665)
 			pr_err("HP Calibration Failure\n");
 			regmap_write(rt5665->regmap, RT5665_RESET, 0);
 			regcache_cache_bypass(rt5665->regmap, false);
-			return;
+			goto unlock;
 		}
 
 		count++;
@@ -4606,7 +4606,7 @@ static void rt5665_calibrate(struct rt5665_priv *rt5665)
 			pr_err("MONO Calibration Failure\n");
 			regmap_write(rt5665->regmap, RT5665_RESET, 0);
 			regcache_cache_bypass(rt5665->regmap, false);
-			return;
+			goto unlock;
 		}
 
 		count++;
@@ -4620,7 +4620,7 @@ static void rt5665_calibrate(struct rt5665_priv *rt5665)
 
 	regmap_write(rt5665->regmap, RT5665_BIAS_CUR_CTRL_8, 0xa602);
 	regmap_write(rt5665->regmap, RT5665_ASRC_8, 0x0120);
-
+unlock:
 	mutex_unlock(&rt5665->calibrate_mutex);
 }
 
maintainer
#1 lore raw
Quoted 4 lines · Dan Carpenter

We should probably unlock before returning here.

Fixes 33ada14a26c8 ("ASoC: add rt5665 codec driver")

This doesn't apply against current code, please check and resend.