Skip to content

Commit

Permalink
ASoC: core: Fix to check return value of snd_soc_update_bits_locked()
Browse files Browse the repository at this point in the history
It can be 0 or 1 return value of snd_soc_update_bits_locked() when it is
success. So just check return value is negative.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Joonyoung Shim authored and broonie committed Mar 26, 2013
1 parent f7ba716 commit 0eaa6cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2963,7 +2963,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
val = val << shift;

ret = snd_soc_update_bits_locked(codec, reg, val_mask, val);
if (ret != 0)
if (ret < 0)
return ret;

if (snd_soc_volsw_is_stereo(mc)) {
Expand Down

0 comments on commit 0eaa6cc

Please sign in to comment.