From 0087f2013188d8b332cee2f74fd3c6754a49f620 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Wed, 4 Oct 2017 23:04:27 -0500
Subject: [PATCH] ASoC: Intel: cht_bsw_max98090: remove useless code, align with ChromeOS driver
Git-commit: 0087f2013188d8b332cee2f74fd3c6754a49f620
Patch-mainline: v4.15-rc1
References: bsc#1051510
Remove dead code which was missed in previous changes. This is not
visible with git diff but there is a test+return on the same condition
just above.
Also reuse local variable instead of fetching the jack information twice.
Tested on Acer R11 (cyan)
Fixes: 3bbda5a38601 ('ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization')
Cc: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Takashi Iwai <tiwai@suse.de>
---
sound/soc/intel/boards/cht_bsw_max98090_ti.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -184,9 +184,6 @@ static int cht_codec_init(struct snd_soc
return ret;
}
- if (ctx->ts3a227e_present)
- snd_soc_jack_notifier_register(jack, &cht_jack_nb);
-
/*
* The firmware might enable the clock at
* boot (this information may or may not
@@ -275,7 +272,7 @@ static int cht_max98090_headset_init(str
return ret;
}
- return ts3a227e_enable_jack_detect(component, &ctx->jack);
+ return ts3a227e_enable_jack_detect(component, jack);
}
static const struct snd_soc_ops cht_aif1_ops = {