From: Pierre-Louis Bossart Date: Thu, 5 Oct 2017 04:04:27 +0000 (-0500) Subject: ASoC: Intel: cht_bsw_max98090: remove useless code, align with ChromeOS driver X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=0087f2013188d8b332cee2f74fd3c6754a49f620;p=openwrt%2Fstaging%2Fblogic.git ASoC: Intel: cht_bsw_max98090: remove useless code, align with ChromeOS driver 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 Signed-off-by: Pierre-Louis Bossart Acked-By: Vinod Koul Signed-off-by: Mark Brown --- diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c index 6519604b9577..a23eba7bb056 100644 --- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c +++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c @@ -219,10 +219,6 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) return ret; } - - if (ctx->ts3a227e_present) - snd_soc_jack_notifier_register(jack, &cht_jack_nb); - ret = snd_soc_jack_add_gpiods(runtime->card->dev->parent, jack, ARRAY_SIZE(hs_jack_gpios), hs_jack_gpios); @@ -323,7 +319,7 @@ static int cht_max98090_headset_init(struct snd_soc_component *component) 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 = {