Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281419
b: refs/heads/master
c: e38c79e
h: refs/heads/master
i:
  281417: 85eb6a3
  281415: 39f27c0
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Greg Kroah-Hartman committed Dec 22, 2011
1 parent d156c1d commit 9d1290f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5fd6218ca5928e4b59eb8a496aa1428fae1fb0d6
refs/heads/master: e38c79e0825b673d97cecfb36bae9e859e724f1b
17 changes: 12 additions & 5 deletions trunk/drivers/staging/iio/industrialio-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,20 @@ ssize_t iio_buffer_write_length(struct device *dev,
if (val == buffer->access->get_length(buffer))
return len;

if (buffer->access->set_length) {
buffer->access->set_length(buffer, val);
if (buffer->access->mark_param_change)
buffer->access->mark_param_change(buffer);
mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev)) {
ret = -EBUSY;
} else {
if (buffer->access->set_length) {
buffer->access->set_length(buffer, val);
if (buffer->access->mark_param_change)
buffer->access->mark_param_change(buffer);
}
ret = 0;
}
mutex_unlock(&indio_dev->mlock);

return len;
return ret ? ret : len;
}
EXPORT_SYMBOL(iio_buffer_write_length);

Expand Down

0 comments on commit 9d1290f

Please sign in to comment.