Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268533
b: refs/heads/master
c: 30eb82f
h: refs/heads/master
i:
  268531: 14ff231
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Sep 27, 2011
1 parent 25da587 commit 136b0b2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 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: ad31d250bf60c8e4c990e8b0daeedbaa2d6884a9
refs/heads/master: 30eb82f05dd1f12b18a0ad054401a0b5690fb3c3
9 changes: 6 additions & 3 deletions trunk/drivers/staging/iio/iio_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int __iio_add_chan_devattr(const char *postfix,
#ifdef CONFIG_IIO_BUFFER
struct poll_table_struct;

void iio_chrdev_buffer_open(struct iio_dev *indio_dev);
int iio_chrdev_buffer_open(struct iio_dev *indio_dev);
void iio_chrdev_buffer_release(struct iio_dev *indio_dev);

unsigned int iio_buffer_poll(struct file *filp,
Expand All @@ -47,8 +47,11 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf,

#else

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

static inline void iio_chrdev_buffer_release(struct iio_dev *indio_dev)
{}

Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/staging/iio/industrialio-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,14 @@ unsigned int iio_buffer_poll(struct file *filp,
return 0;
}

void iio_chrdev_buffer_open(struct iio_dev *indio_dev)
int iio_chrdev_buffer_open(struct iio_dev *indio_dev)
{
struct iio_buffer *rb = indio_dev->buffer;
if (rb && rb->access->mark_in_use)
if (!rb)
return -EINVAL;
if (rb->access->mark_in_use)
rb->access->mark_in_use(rb);
return 0;
}

void iio_chrdev_buffer_release(struct iio_dev *indio_dev)
Expand All @@ -77,7 +80,6 @@ void iio_chrdev_buffer_release(struct iio_dev *indio_dev)
clear_bit(IIO_BUSY_BIT_POS, &rb->flags);
if (rb->access->unmark_in_use)
rb->access->unmark_in_use(rb);

}

void iio_buffer_init(struct iio_buffer *buffer, struct iio_dev *dev_info)
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,8 +1065,8 @@ static int iio_chrdev_open(struct inode *inode, struct file *filp)
struct iio_dev *dev_info = container_of(inode->i_cdev,
struct iio_dev, chrdev);
filp->private_data = dev_info;
iio_chrdev_buffer_open(dev_info);
return 0;

return iio_chrdev_buffer_open(dev_info);
}

/**
Expand Down

0 comments on commit 136b0b2

Please sign in to comment.