From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Michael Hennerich <michael.hennerich@analog.com>,
<linux-iio@vger.kernel.org>,
<device-drivers-devel@blackfin.uclinux.org>, <drivers@analog.com>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 1/2] staging:iio: Make write_event_value callback optional
Date: Wed, 26 Oct 2011 14:01:06 +0200 [thread overview]
Message-ID: <1319630467-6924-1-git-send-email-lars@metafoo.de> (raw)
Some devices have fixed thresholds which can not be modified so make the
write_event_value callback optional, so the drivers for these devices do not
have to implement a boilerplate no-op callback.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/staging/iio/industrialio-core.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c
index cfa4fcb..d2eea07 100644
--- a/drivers/staging/iio/industrialio-core.c
+++ b/drivers/staging/iio/industrialio-core.c
@@ -782,6 +782,9 @@ static ssize_t iio_ev_value_store(struct device *dev,
unsigned long val;
int ret;
+ if (!indio_dev->info->write_event_value)
+ return -EINVAL;
+
ret = strict_strtoul(buf, 10, &val);
if (ret)
return ret;
--
1.7.7
next reply other threads:[~2011-10-26 12:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-26 12:01 Lars-Peter Clausen [this message]
2011-10-26 12:01 ` [PATCH 2/2] staging:iio:dac: Add AD5421 driver Lars-Peter Clausen
2011-10-26 13:21 ` Lars-Peter Clausen
2011-10-26 17:04 ` Jonathan Cameron
2011-10-27 7:25 ` Lars-Peter Clausen
2011-10-26 12:02 ` [PATCH 1/2] staging:iio: Make write_event_value callback optional 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=1319630467-6924-1-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=device-drivers-devel@blackfin.uclinux.org \
--cc=drivers@analog.com \
--cc=jic23@cam.ac.uk \
--cc=linux-iio@vger.kernel.org \
--cc=michael.hennerich@analog.com \
/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