diff options
| author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-12-01 05:39:51 -0500 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2015-12-01 11:46:46 -0500 |
| commit | 319c32597fc22a58b946a6146f2be1fd208582e0 (patch) | |
| tree | 94ed8c65d56ee6261149df24e29fdb5bdb566bfc | |
| parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) | |
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: 12cc6d1dca4d ("ASoC: tegra_alc5632: Register jacks at the card level")
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | sound/soc/tegra/tegra_alc5632.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c index ba272e21a6fa..deb597f7c302 100644 --- a/sound/soc/tegra/tegra_alc5632.c +++ b/sound/soc/tegra/tegra_alc5632.c | |||
| @@ -101,12 +101,16 @@ static const struct snd_kcontrol_new tegra_alc5632_controls[] = { | |||
| 101 | 101 | ||
| 102 | static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd) | 102 | static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd) |
| 103 | { | 103 | { |
| 104 | int ret; | ||
| 104 | struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(rtd->card); | 105 | struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(rtd->card); |
| 105 | 106 | ||
| 106 | snd_soc_card_jack_new(rtd->card, "Headset Jack", SND_JACK_HEADSET, | 107 | ret = snd_soc_card_jack_new(rtd->card, "Headset Jack", |
| 107 | &tegra_alc5632_hs_jack, | 108 | SND_JACK_HEADSET, |
| 108 | tegra_alc5632_hs_jack_pins, | 109 | &tegra_alc5632_hs_jack, |
| 109 | ARRAY_SIZE(tegra_alc5632_hs_jack_pins)); | 110 | tegra_alc5632_hs_jack_pins, |
| 111 | ARRAY_SIZE(tegra_alc5632_hs_jack_pins)); | ||
| 112 | if (ret) | ||
| 113 | return ret; | ||
| 110 | 114 | ||
| 111 | if (gpio_is_valid(machine->gpio_hp_det)) { | 115 | if (gpio_is_valid(machine->gpio_hp_det)) { |
| 112 | tegra_alc5632_hp_jack_gpio.gpio = machine->gpio_hp_det; | 116 | tegra_alc5632_hp_jack_gpio.gpio = machine->gpio_hp_det; |
