aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/tegra/tegra_wm8903.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-05-22 18:08:53 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-03 08:06:37 -0400
commit14df415a38234aa483219335bc6c1ee899b85e10 (patch)
tree243bc6bc30b7fe3faee0d6ce3b15e34fc99ebe89 /sound/soc/tegra/tegra_wm8903.c
parent9f6328d910ef8df8176ed433aa2de037eba1f656 (diff)
ASoC: tegra+wm8903: simplify gpio tests in widget callbacks
By the time any widget callbacks could be called, if the GPIO ID they will manipulate is valid, it must have already been requested, or the card would have failed to probe or initialize. So, testing for GPIO validity is equivalent to testing whether the GPIO was successfully requested at this point in the code. Making this change will allow later patches to remove the gpio_requested variable. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/tegra/tegra_wm8903.c')
-rw-r--r--sound/soc/tegra/tegra_wm8903.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
index 9059525f3b08..1fd6a41b9162 100644
--- a/sound/soc/tegra/tegra_wm8903.c
+++ b/sound/soc/tegra/tegra_wm8903.c
@@ -153,7 +153,7 @@ static int tegra_wm8903_event_int_spk(struct snd_soc_dapm_widget *w,
153 struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card); 153 struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);
154 struct tegra_wm8903_platform_data *pdata = &machine->pdata; 154 struct tegra_wm8903_platform_data *pdata = &machine->pdata;
155 155
156 if (!(machine->gpio_requested & GPIO_SPKR_EN)) 156 if (!gpio_is_valid(pdata->gpio_spkr_en))
157 return 0; 157 return 0;
158 158
159 gpio_set_value_cansleep(pdata->gpio_spkr_en, 159 gpio_set_value_cansleep(pdata->gpio_spkr_en,
@@ -170,7 +170,7 @@ static int tegra_wm8903_event_hp(struct snd_soc_dapm_widget *w,
170 struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card); 170 struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);
171 struct tegra_wm8903_platform_data *pdata = &machine->pdata; 171 struct tegra_wm8903_platform_data *pdata = &machine->pdata;
172 172
173 if (!(machine->gpio_requested & GPIO_HP_MUTE)) 173 if (!gpio_is_valid(pdata->gpio_hp_mute))
174 return 0; 174 return 0;
175 175
176 gpio_set_value_cansleep(pdata->gpio_hp_mute, 176 gpio_set_value_cansleep(pdata->gpio_hp_mute,