[alsa-devel] [PATCH] ASoC: Intel: cht_bsw_max98090: remove useless code, align with ChromeOS driver
Vinod Koul
vinod.koul at intel.com
Mon Oct 9 11:16:14 CEST 2017
On Wed, Oct 04, 2017 at 11:04:27PM -0500, Pierre-Louis Bossart wrote:
> 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)
Acked-By: Vinod Koul <vinod.koul at intel.com>
> Fixes: 3bbda5a38601 ('ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization')
> Cc: Thierry Escande <thierry.escande at collabora.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
> ---
> sound/soc/intel/boards/cht_bsw_max98090_ti.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
> index 74c047a4b05c..119da5503fee 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 = {
> --
> 2.11.0
>
--
~Vinod
More information about the Alsa-devel
mailing list