linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] staging:iio:adt7410: Fix adt7410_set_mode return value
@ 2012-10-22  9:42 Lars-Peter Clausen
  2012-10-22  9:42 ` [PATCH 2/2] staging:iio: Consolidate adt7310 and adt7410 driver Lars-Peter Clausen
  2012-10-31 10:50 ` [PATCH 1/2] staging:iio:adt7410: Fix adt7410_set_mode return value Jonathan Cameron
  0 siblings, 2 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2012-10-22  9:42 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, drivers, Lars-Peter Clausen

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>
---
 drivers/staging/iio/adc/adt7410.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/adc/adt7410.c b/drivers/staging/iio/adc/adt7410.c
index 4157596..3cf5103 100644
--- a/drivers/staging/iio/adc/adt7410.c
+++ b/drivers/staging/iio/adc/adt7410.c
@@ -190,7 +190,7 @@ static ssize_t adt7410_store_mode(struct device *dev,
 
 	chip->config = config;
 
-	return ret;
+	return len;
 }
 
 static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR,
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-31 10:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-22  9:42 [PATCH 1/2] staging:iio:adt7410: Fix adt7410_set_mode return value Lars-Peter Clausen
2012-10-22  9:42 ` [PATCH 2/2] staging:iio: Consolidate adt7310 and adt7410 driver Lars-Peter Clausen
2012-10-31 10:51   ` Jonathan Cameron
2012-10-31 10:50 ` [PATCH 1/2] staging:iio:adt7410: Fix adt7410_set_mode return value Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).