aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/pcm512x.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/pcm512x.c')
-rw-r--r--sound/soc/codecs/pcm512x.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
index 6cb1653be804..4cc24a5d5c31 100644
--- a/sound/soc/codecs/pcm512x.c
+++ b/sound/soc/codecs/pcm512x.c
@@ -1400,24 +1400,20 @@ static int pcm512x_digital_mute(struct snd_soc_dai *dai, int mute)
1400 if (ret != 0) { 1400 if (ret != 0) {
1401 dev_err(component->dev, 1401 dev_err(component->dev,
1402 "Failed to set digital mute: %d\n", ret); 1402 "Failed to set digital mute: %d\n", ret);
1403 mutex_unlock(&pcm512x->mutex); 1403 goto unlock;
1404 return ret;
1405 } 1404 }
1406 1405
1407 regmap_read_poll_timeout(pcm512x->regmap, 1406 regmap_read_poll_timeout(pcm512x->regmap,
1408 PCM512x_ANALOG_MUTE_DET, 1407 PCM512x_ANALOG_MUTE_DET,
1409 mute_det, (mute_det & 0x3) == 0, 1408 mute_det, (mute_det & 0x3) == 0,
1410 200, 10000); 1409 200, 10000);
1411
1412 mutex_unlock(&pcm512x->mutex);
1413 } else { 1410 } else {
1414 pcm512x->mute &= ~0x1; 1411 pcm512x->mute &= ~0x1;
1415 ret = pcm512x_update_mute(pcm512x); 1412 ret = pcm512x_update_mute(pcm512x);
1416 if (ret != 0) { 1413 if (ret != 0) {
1417 dev_err(component->dev, 1414 dev_err(component->dev,
1418 "Failed to update digital mute: %d\n", ret); 1415 "Failed to update digital mute: %d\n", ret);
1419 mutex_unlock(&pcm512x->mutex); 1416 goto unlock;
1420 return ret;
1421 } 1417 }
1422 1418
1423 regmap_read_poll_timeout(pcm512x->regmap, 1419 regmap_read_poll_timeout(pcm512x->regmap,
@@ -1428,9 +1424,10 @@ static int pcm512x_digital_mute(struct snd_soc_dai *dai, int mute)
1428 200, 10000); 1424 200, 10000);
1429 } 1425 }
1430 1426
1427unlock:
1431 mutex_unlock(&pcm512x->mutex); 1428 mutex_unlock(&pcm512x->mutex);
1432 1429
1433 return 0; 1430 return ret;
1434} 1431}
1435 1432
1436static const struct snd_soc_dai_ops pcm512x_dai_ops = { 1433static const struct snd_soc_dai_ops pcm512x_dai_ops = {