Blob Blame History Raw
From 221034aca4fdcf8a6552267d2d3aa6825fae29b1 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Wed, 4 Aug 2021 14:24:54 -0500
Subject: [PATCH] ASoC: max98090: remove duplicate status reads and useless assignmment
Git-commit: 221034aca4fdcf8a6552267d2d3aa6825fae29b1
Patch-mainline: v5.15-rc1
References: bsc#1192354

The logic for the jack detection has not changed since the first
commit for this driver. Remove a duplicate read and remove useless
assignment

sound/soc/codecs/max98090.c:2170:6: style: Variable 'reg' is
reassigned a value before the old one has been
used. [redundantAssignment]
 reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
     ^

sound/soc/codecs/max98090.c:2161:7: note: reg is assigned
  reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
      ^

sound/soc/codecs/max98090.c:2170:6: note: reg is overwritten
 reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
     ^

sound/soc/codecs/max98090.c:2170:6: style: Variable 'reg' is
reassigned a value before the old one has been
used. [redundantAssignment]
 reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
     ^

sound/soc/codecs/max98090.c:2167:7: note: reg is assigned
  reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
      ^

sound/soc/codecs/max98090.c:2170:6: note: reg is overwritten
 reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
     ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210804192456.278702-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 sound/soc/codecs/max98090.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index bc30a1dc7530..b45ec35cd63c 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2158,13 +2158,11 @@ static void max98090_jack_work(struct work_struct *work)
 
 		msleep(50);
 
-		reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
+		snd_soc_component_read(component, M98090_REG_JACK_STATUS);
 
 		/* Weak pull up allows only insertion detection */
 		snd_soc_component_update_bits(component, M98090_REG_JACK_DETECT,
 			M98090_JDWK_MASK, M98090_JDWK_MASK);
-	} else {
-		reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
 	}
 
 	reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
-- 
2.26.2