All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] staging:iio: Make write_event_value callback optional
@ 2011-10-27  8:44 Lars-Peter Clausen
  2011-10-27  8:44 ` [PATCH 2/3] staging:iio: IIO_EVENT_CODE: Clamp channel numbers Lars-Peter Clausen
  2011-10-27  8:44 ` [PATCH v2 3/3] staging:iio:dac: Add AD5421 driver Lars-Peter Clausen
  0 siblings, 2 replies; 8+ messages in thread
From: Lars-Peter Clausen @ 2011-10-27  8:44 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>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
---
 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] 8+ messages in thread
* [PATCH 1/3] staging:iio: Make write_event_value callback optional
@ 2011-11-02  8:40 Lars-Peter Clausen
  2011-11-02  8:40 ` [PATCH 2/3] staging:iio: IIO_EVENT_CODE: Clamp channel numbers Lars-Peter Clausen
  0 siblings, 1 reply; 8+ messages in thread
From: Lars-Peter Clausen @ 2011-11-02  8:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jonathan Cameron, Michael Hennerich, devel, 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>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
---
 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] 8+ messages in thread

end of thread, other threads:[~2011-11-02  8:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-27  8:44 [PATCH 1/3] staging:iio: Make write_event_value callback optional Lars-Peter Clausen
2011-10-27  8:44 ` [PATCH 2/3] staging:iio: IIO_EVENT_CODE: Clamp channel numbers Lars-Peter Clausen
2011-10-27  9:02   ` Lars-Peter Clausen
2011-10-31 12:30     ` Jonathan Cameron
2011-10-27  8:44 ` [PATCH v2 3/3] staging:iio:dac: Add AD5421 driver Lars-Peter Clausen
2011-10-31 11:28   ` Jonathan Cameron
2011-10-31 12:14     ` Lars-Peter Clausen
  -- strict thread matches above, loose matches on Subject: below --
2011-11-02  8:40 [PATCH 1/3] staging:iio: Make write_event_value callback optional Lars-Peter Clausen
2011-11-02  8:40 ` [PATCH 2/3] staging:iio: IIO_EVENT_CODE: Clamp channel numbers Lars-Peter Clausen

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.