Commit 8fe47099 authored by Cezary Rojewski's avatar Cezary Rojewski Committed by Mark Brown

ASoC: Intel: bdw_rt286: Improve codec_init() quality

Drop redundant 'ret' assignemnt, stop ignoring set_jack() return value
and reword local 'component' variable to 'codec' to improve readability.
Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Tested-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220620101402.2684366-16-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 423cc2d0
...@@ -61,8 +61,8 @@ static const struct snd_soc_dapm_route card_routes[] = { ...@@ -61,8 +61,8 @@ static const struct snd_soc_dapm_route card_routes[] = {
static int codec_link_init(struct snd_soc_pcm_runtime *rtd) static int codec_link_init(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; struct snd_soc_component *codec = asoc_rtd_to_codec(rtd, 0)->component;
int ret = 0; int ret;
ret = snd_soc_card_jack_new_pins(rtd->card, "Headset", SND_JACK_HEADSET | SND_JACK_BTN_0, ret = snd_soc_card_jack_new_pins(rtd->card, "Headset", SND_JACK_HEADSET | SND_JACK_BTN_0,
&card_headset, card_headset_pins, &card_headset, card_headset_pins,
...@@ -70,8 +70,7 @@ static int codec_link_init(struct snd_soc_pcm_runtime *rtd) ...@@ -70,8 +70,7 @@ static int codec_link_init(struct snd_soc_pcm_runtime *rtd)
if (ret) if (ret)
return ret; return ret;
snd_soc_component_set_jack(component, &card_headset, NULL); return snd_soc_component_set_jack(codec, &card_headset, NULL);
return 0;
} }
static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment