Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275955
b: refs/heads/master
c: aaa0b4f
h: refs/heads/master
i:
  275953: 7009795
  275951: 281c805
v: v3
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Nov 26, 2011
1 parent caa2dbd commit b08cc91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 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: ac03564f90bbe141e1fd917bde0ed3fee79a0dce
refs/heads/master: aaa0b4f00729d5530b7d983930e60255574b347b
19 changes: 9 additions & 10 deletions trunk/drivers/staging/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,25 +242,24 @@ static const struct file_operations iio_event_chrdev_fileops = {

static int iio_event_getfd(struct iio_dev *indio_dev)
{
struct iio_event_interface *ev_int = indio_dev->event_interface;
int fd;

if (indio_dev->event_interface == NULL)
if (ev_int == NULL)
return -ENODEV;

mutex_lock(&indio_dev->event_interface->event_list_lock);
if (test_and_set_bit(IIO_BUSY_BIT_POS,
&indio_dev->event_interface->flags)) {
mutex_unlock(&indio_dev->event_interface->event_list_lock);
mutex_lock(&ev_int->event_list_lock);
if (test_and_set_bit(IIO_BUSY_BIT_POS, &ev_int->flags)) {
mutex_unlock(&ev_int->event_list_lock);
return -EBUSY;
}
mutex_unlock(&indio_dev->event_interface->event_list_lock);
mutex_unlock(&ev_int->event_list_lock);
fd = anon_inode_getfd("iio:event",
&iio_event_chrdev_fileops,
indio_dev->event_interface, O_RDONLY);
&iio_event_chrdev_fileops, ev_int, O_RDONLY);
if (fd < 0) {
mutex_lock(&indio_dev->event_interface->event_list_lock);
mutex_lock(&ev_int->event_list_lock);
clear_bit(IIO_BUSY_BIT_POS, &ev_int->flags);
mutex_unlock(&indio_dev->event_interface->event_list_lock);
mutex_unlock(&ev_int->event_list_lock);
}
return fd;
}
Expand Down

0 comments on commit b08cc91

Please sign in to comment.