Commit fe75fe0e authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: Fix return value of wm8962_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: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 16aff769
...@@ -3878,13 +3878,17 @@ static int wm8962_gpio_direction_out(struct gpio_chip *chip, ...@@ -3878,13 +3878,17 @@ static int wm8962_gpio_direction_out(struct gpio_chip *chip,
{ {
struct wm8962_priv *wm8962 = gpio_to_wm8962(chip); struct wm8962_priv *wm8962 = gpio_to_wm8962(chip);
struct snd_soc_codec *codec = wm8962->codec; struct snd_soc_codec *codec = wm8962->codec;
int val; int ret, val;
/* Force function 1 (logic output) */ /* Force function 1 (logic output) */
val = (1 << WM8962_GP2_FN_SHIFT) | (value << WM8962_GP2_LVL_SHIFT); val = (1 << WM8962_GP2_FN_SHIFT) | (value << WM8962_GP2_LVL_SHIFT);
return snd_soc_update_bits(codec, WM8962_GPIO_BASE + offset, ret = snd_soc_update_bits(codec, WM8962_GPIO_BASE + offset,
WM8962_GP2_FN_MASK | WM8962_GP2_LVL, val); WM8962_GP2_FN_MASK | WM8962_GP2_LVL, val);
if (ret < 0)
return ret;
return 0;
} }
static struct gpio_chip wm8962_template_chip = { static struct gpio_chip wm8962_template_chip = {
......
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