diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-31 15:02:13 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-31 15:08:31 -0400 |
commit | 64964e82644e9f809dc83019186c21ed5b70aa56 (patch) | |
tree | 521fbcc4b739804945bdbe44fe2f605798810ef5 /sound/soc/codecs | |
parent | 5a7c5f26df3c0122814dfa1c13ef6dfbdbffdb86 (diff) |
ASoC: Fix return value of wm5100_gpio_direction_out()
We can't just pass back the return value of snd_soc_update_bits() as it
will be 1 if a bit changed rather than zero.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/wm5100.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c index 5d88c99aaea6..42d9039a49e9 100644 --- a/sound/soc/codecs/wm5100.c +++ b/sound/soc/codecs/wm5100.c | |||
@@ -2361,13 +2361,17 @@ static int wm5100_gpio_direction_out(struct gpio_chip *chip, | |||
2361 | { | 2361 | { |
2362 | struct wm5100_priv *wm5100 = gpio_to_wm5100(chip); | 2362 | struct wm5100_priv *wm5100 = gpio_to_wm5100(chip); |
2363 | struct snd_soc_codec *codec = wm5100->codec; | 2363 | struct snd_soc_codec *codec = wm5100->codec; |
2364 | int val; | 2364 | int val, ret; |
2365 | 2365 | ||
2366 | val = (1 << WM5100_GP1_FN_SHIFT) | (!!value << WM5100_GP1_LVL_SHIFT); | 2366 | val = (1 << WM5100_GP1_FN_SHIFT) | (!!value << WM5100_GP1_LVL_SHIFT); |
2367 | 2367 | ||
2368 | return snd_soc_update_bits(codec, WM5100_GPIO_CTRL_1 + offset, | 2368 | ret = snd_soc_update_bits(codec, WM5100_GPIO_CTRL_1 + offset, |
2369 | WM5100_GP1_FN_MASK | WM5100_GP1_DIR | | 2369 | WM5100_GP1_FN_MASK | WM5100_GP1_DIR | |
2370 | WM5100_GP1_LVL, val); | 2370 | WM5100_GP1_LVL, val); |
2371 | if (ret < 0) | ||
2372 | return ret; | ||
2373 | else | ||
2374 | return 0; | ||
2371 | } | 2375 | } |
2372 | 2376 | ||
2373 | static int wm5100_gpio_get(struct gpio_chip *chip, unsigned offset) | 2377 | static int wm5100_gpio_get(struct gpio_chip *chip, unsigned offset) |