All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging:iio: Make write_event_value callback optional
@ 2011-10-26 12:01 Lars-Peter Clausen
  2011-10-26 12:01 ` [PATCH 2/2] staging:iio:dac: Add AD5421 driver Lars-Peter Clausen
  2011-10-26 12:02 ` [PATCH 1/2] staging:iio: Make write_event_value callback optional Jonathan Cameron
  0 siblings, 2 replies; 6+ messages in thread
From: Lars-Peter Clausen @ 2011-10-26 12:01 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Michael Hennerich, linux-iio, device-drivers-devel, drivers,
	Lars-Peter Clausen

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

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

end of thread, other threads:[~2011-10-27  7:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-26 12:01 [PATCH 1/2] staging:iio: Make write_event_value callback optional Lars-Peter Clausen
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.