iio:ad5064: Make sure ad5064_i2c_write() returns 0 on success
authorMichael Hennerich <michael.hennerich@analog.com>
Tue, 13 Oct 2015 16:15:37 +0000 (18:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Feb 2016 19:57:48 +0000 (11:57 -0800)
commit3effd3faeaa18907ba672f4545d0ba4602a2eb8b
tree9f6b5109205fdaa5b68dc823ab4b7548ac875af5
parentaac11e32617a7de35937748d1f33aae33be0dff0
iio:ad5064: Make sure ad5064_i2c_write() returns 0 on success

commit 03fe472ef33b7f31fbd11d300dbb3fdab9c00fd4 upstream.

i2c_master_send() returns the number of bytes transferred on success while
the ad5064 driver expects that the write() callback returns 0 on success.
Fix that by translating any non negative return value of i2c_master_send()
to 0.

Fixes: commit 6a17a0768f77 ("iio:dac:ad5064: Add support for the ad5629r and ad5669r")
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/dac/ad5064.c