Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280998
b: refs/heads/master
c: 96e00f1
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Nov 27, 2011
1 parent b531afa commit 3076fa4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 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: bc9f35db8fed28d8fa1195b3927c8e1e91d64388
refs/heads/master: 96e00f110fae862b61f3db9dc25fe8f0f43f77e9
2 changes: 1 addition & 1 deletion trunk/drivers/staging/iio/iio_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf,

static inline int iio_chrdev_buffer_open(struct iio_dev *indio_dev)
{
return -EINVAL;
return 0;
}

static inline void iio_chrdev_buffer_release(struct iio_dev *indio_dev)
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/staging/iio/industrialio-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf,
struct iio_dev *indio_dev = filp->private_data;
struct iio_buffer *rb = indio_dev->buffer;

if (!rb->access->read_first_n)
if (!rb || !rb->access->read_first_n)
return -EINVAL;
return rb->access->read_first_n(rb, n, buf);
}
Expand All @@ -68,7 +68,7 @@ int iio_chrdev_buffer_open(struct iio_dev *indio_dev)
{
struct iio_buffer *rb = indio_dev->buffer;
if (!rb)
return -EINVAL;
return 0;
if (rb->access->mark_in_use)
rb->access->mark_in_use(rb);
return 0;
Expand All @@ -78,6 +78,8 @@ void iio_chrdev_buffer_release(struct iio_dev *indio_dev)
{
struct iio_buffer *rb = indio_dev->buffer;

if (!rb)
return;
clear_bit(IIO_BUSY_BIT_POS, &rb->flags);
if (rb->access->unmark_in_use)
rb->access->unmark_in_use(rb);
Expand Down

0 comments on commit 3076fa4

Please sign in to comment.