From: Joonyoung Shim Date: Tue, 26 Mar 2013 05:41:05 +0000 (+0900) Subject: ASoC: core: Fix to check return value of snd_soc_update_bits_locked() X-Git-Tag: v3.8.8~26 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8047d57ee07e9cd7f4899c1f7961f8d73faa24c8;p=users%2Fjedix%2Flinux-maple.git ASoC: core: Fix to check return value of snd_soc_update_bits_locked() commit 0eaa6cca1f75e12e4f5ec62cbe887330fe3b5fe9 upstream. 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 Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 2370063b58245..f3ab91865fa19 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2959,7 +2959,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)) {