From: Axel Lin Date: Tue, 1 Nov 2011 07:17:57 +0000 (+0800) Subject: ASoC: Avoid a redundant read in cs42l51_pdn_event X-Git-Tag: MMI-PSA29.97-13-9~16612^2~492 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e94de1e864d2d205e4e503b0f083c07f288b45fe;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git ASoC: Avoid a redundant read in cs42l51_pdn_event snd_soc_update_bits already does read-modify-write, no need to read the register before calling snd_soc_update_bits. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c index 8c3c8205d19e..00718b5e747b 100644 --- a/sound/soc/codecs/cs42l51.c +++ b/sound/soc/codecs/cs42l51.c @@ -175,21 +175,18 @@ static const struct snd_kcontrol_new cs42l51_snd_controls[] = { static int cs42l51_pdn_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { - unsigned long value; - - value = snd_soc_read(w->codec, CS42L51_POWER_CTL1); - value &= ~CS42L51_POWER_CTL1_PDN; - switch (event) { case SND_SOC_DAPM_PRE_PMD: - value |= CS42L51_POWER_CTL1_PDN; + snd_soc_update_bits(w->codec, CS42L51_POWER_CTL1, + CS42L51_POWER_CTL1_PDN, + CS42L51_POWER_CTL1_PDN); break; default: case SND_SOC_DAPM_POST_PMD: + snd_soc_update_bits(w->codec, CS42L51_POWER_CTL1, + CS42L51_POWER_CTL1_PDN, 0); break; } - snd_soc_update_bits(w->codec, CS42L51_POWER_CTL1, - CS42L51_POWER_CTL1_PDN, value); return 0; }