Skip to content

Commit

Permalink
staging:iio: Make write_event_value callback optional
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Lars-Peter Clausen authored and Greg Kroah-Hartman committed Nov 27, 2011
1 parent 685e010 commit 43c0364
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/staging/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,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;
Expand Down

0 comments on commit 43c0364

Please sign in to comment.