aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-10-22 05:42:00 -0400
committerJonathan Cameron <jic23@kernel.org>2012-11-17 05:17:17 -0500
commite8f45e3341ed8609174f9c21fb47e202f29ab039 (patch)
tree3132d0748245897d032833c13e777850d05d4964 /drivers/staging
parent69bcd3bf40228239db91b075f56f9ba511f0bfe1 (diff)
staging:iio:adt7410: Fix adt7410_set_mode return value
The function is expected to return the number of bytes consumed and as long as not all bytes have been consumed the function will be called again. Currently the function returns 'ret', which will always be 0 in this case, so we end up in a endless loop since the caller will assume that no bytes have been consumed. So instead return len as it is supposed to. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/iio/adc/adt7410.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/iio/adc/adt7410.c b/drivers/staging/iio/adc/adt7410.c
index 5e93d868b3fe..6493cd0a48dd 100644
--- a/drivers/staging/iio/adc/adt7410.c
+++ b/drivers/staging/iio/adc/adt7410.c
@@ -181,7 +181,7 @@ static ssize_t adt7410_store_mode(struct device *dev,
181 181
182 chip->config = config; 182 chip->config = config;
183 183
184 return ret; 184 return len;
185} 185}
186 186
187static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, 187static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR,