[PATCH v2 15/17] ASoC: Intel: bdw_rt286: Improve codec_link_init() quality
Cezary Rojewski
cezary.rojewski at intel.com
Mon Jun 13 11:15:44 CEST 2022
Drop redundant 'ret' assignemnt, stop ignoring set_jack() return value
and reword local 'component' variable to 'codec' to improve readability.
Signed-off-by: Cezary Rojewski <cezary.rojewski at intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski at linux.intel.com>
---
sound/soc/intel/boards/bdw_rt286.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/sound/soc/intel/boards/bdw_rt286.c b/sound/soc/intel/boards/bdw_rt286.c
index c21f71b477d5..92fddf6061e8 100644
--- a/sound/soc/intel/boards/bdw_rt286.c
+++ b/sound/soc/intel/boards/bdw_rt286.c
@@ -61,8 +61,8 @@ static const struct snd_soc_dapm_route card_routes[] = {
static int codec_link_init(struct snd_soc_pcm_runtime *rtd)
{
- struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
- int ret = 0;
+ struct snd_soc_component *codec = asoc_rtd_to_codec(rtd, 0)->component;
+ int ret;
ret = snd_soc_card_jack_new_pins(rtd->card, "Headset", SND_JACK_HEADSET | SND_JACK_BTN_0,
&card_headset, card_headset_pins,
@@ -70,8 +70,7 @@ static int codec_link_init(struct snd_soc_pcm_runtime *rtd)
if (ret)
return ret;
- snd_soc_component_set_jack(component, &card_headset, NULL);
- return 0;
+ return snd_soc_component_set_jack(codec, &card_headset, NULL);
}
static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
--
2.25.1
More information about the Alsa-devel
mailing list