summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/sigmadsp-i2c.c
diff options
context:
space:
mode:
authorPascal Huerst <pascal.huerst@gmail.com>2016-02-10 17:59:28 +0300
committerMark Brown <broonie@kernel.org>2016-02-10 21:55:01 +0300
commit61c4a1ac4d900e743af0b363fe520405939eab47 (patch)
tree6fd5f91ba08466716ddea39a1c0b75055902bce8 /sound/soc/codecs/sigmadsp-i2c.c
parent92e963f50fc74041b5e9e744c330dca48e04f08d (diff)
downloadlinux-61c4a1ac4d900e743af0b363fe520405939eab47.tar.xz
ASoC: sigmadsp: Fix missleading return value
Forwarding the return value of i2c_master_send, leads to errors later on, since i2c_master_send returns the number of bytes transmittet. Check for ret < 0 instead and return 0 otherwise. Signed-off-by: Pascal Huerst <pascal.huerst@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/sigmadsp-i2c.c')
-rw-r--r--sound/soc/codecs/sigmadsp-i2c.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/codecs/sigmadsp-i2c.c b/sound/soc/codecs/sigmadsp-i2c.c
index 21ca3a5e9f66..d374c18d4db7 100644
--- a/sound/soc/codecs/sigmadsp-i2c.c
+++ b/sound/soc/codecs/sigmadsp-i2c.c
@@ -31,7 +31,10 @@ static int sigmadsp_write_i2c(void *control_data,
kfree(buf);
- return ret;
+ if (ret < 0)
+ return ret;
+
+ return 0;
}
static int sigmadsp_read_i2c(void *control_data,