mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 14:14:37 +00:00
staging:iio: Make write_event_value callback optional
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>
This commit is contained in:
parent
685e010748
commit
43c0364551
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue