]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ASoC: tas2552: Simplify the tas2552_mute function
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Thu, 4 Jun 2015 13:04:18 +0000 (16:04 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 4 Jun 2015 16:50:02 +0000 (17:50 +0100)
Initialize the cfg1_reg to 0 and set the mute bit only when it is needed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas2552.c

index 681b868a9e8c3594806e3456d7b8e648bc335375..2d52a397161dba03a90f3cdf905c46f15382aca7 100644 (file)
@@ -254,13 +254,11 @@ static int tas2552_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
 
 static int tas2552_mute(struct snd_soc_dai *dai, int mute)
 {
-       u8 cfg1_reg;
+       u8 cfg1_reg = 0;
        struct snd_soc_codec *codec = dai->codec;
 
        if (mute)
-               cfg1_reg = TAS2552_MUTE;
-       else
-               cfg1_reg = ~TAS2552_MUTE;
+               cfg1_reg |= TAS2552_MUTE;
 
        snd_soc_update_bits(codec, TAS2552_CFG_1, TAS2552_MUTE, cfg1_reg);