Commit 319c3259 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Mark Brown

ASoC: tegra_alc5632: check return value

We have been returning success even if snd_soc_card_jack_new() fails.
Lets check the return value and return error if it fails.

Fixes: 12cc6d1d ("ASoC: tegra_alc5632: Register jacks at the card level")
Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8005c49d
...@@ -101,12 +101,16 @@ static const struct snd_kcontrol_new tegra_alc5632_controls[] = { ...@@ -101,12 +101,16 @@ static const struct snd_kcontrol_new tegra_alc5632_controls[] = {
static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd) static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd)
{ {
int ret;
struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(rtd->card); struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(rtd->card);
snd_soc_card_jack_new(rtd->card, "Headset Jack", SND_JACK_HEADSET, ret = snd_soc_card_jack_new(rtd->card, "Headset Jack",
&tegra_alc5632_hs_jack, SND_JACK_HEADSET,
tegra_alc5632_hs_jack_pins, &tegra_alc5632_hs_jack,
ARRAY_SIZE(tegra_alc5632_hs_jack_pins)); tegra_alc5632_hs_jack_pins,
ARRAY_SIZE(tegra_alc5632_hs_jack_pins));
if (ret)
return ret;
if (gpio_is_valid(machine->gpio_hp_det)) { if (gpio_is_valid(machine->gpio_hp_det)) {
tegra_alc5632_hp_jack_gpio.gpio = machine->gpio_hp_det; tegra_alc5632_hp_jack_gpio.gpio = machine->gpio_hp_det;
......
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