From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@cam.ac.uk>
Cc: linux-iio@vger.kernel.org, drivers@analog.com,
Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 1/2] staging:iio:adt7410: Fix adt7410_set_mode return value
Date: Mon, 22 Oct 2012 11:42:21 +0200 [thread overview]
Message-ID: <1350898942-29586-1-git-send-email-lars@metafoo.de> (raw)
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
next reply other threads:[~2012-10-22 9:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-22 9:42 Lars-Peter Clausen [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350898942-29586-1-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=drivers@analog.com \
--cc=jic23@cam.ac.uk \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).