Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242119
b: refs/heads/master
c: dfddb24
h: refs/heads/master
i:
  242117: 2e1178d
  242115: 15cce80
  242111: bf5ced2
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 22, 2011
1 parent 5195114 commit c765b74
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 73cb42068cff419e72456940c713ceb5efa68c2a
refs/heads/master: dfddb2441f39e8c0254504516be35b854addf6fa
14 changes: 14 additions & 0 deletions trunk/drivers/media/video/v4l2-fh.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,17 @@ int v4l2_fh_release(struct file *filp)
return 0;
}
EXPORT_SYMBOL_GPL(v4l2_fh_release);

int v4l2_fh_is_singular(struct v4l2_fh *fh)
{
unsigned long flags;
int is_singular;

if (fh == NULL || fh->vdev == NULL)
return 0;
spin_lock_irqsave(&fh->vdev->fh_lock, flags);
is_singular = list_is_singular(&fh->list);
spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
return is_singular;
}
EXPORT_SYMBOL_GPL(v4l2_fh_is_singular);
13 changes: 13 additions & 0 deletions trunk/include/media/v4l2-fh.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,18 @@ void v4l2_fh_exit(struct v4l2_fh *fh);
* v4l2_fh struct) is NULL. This function always returns 0.
*/
int v4l2_fh_release(struct file *filp);
/*
* Returns 1 if this filehandle is the only filehandle opened for the
* associated video_device. If fh is NULL, then it returns 0.
*/
int v4l2_fh_is_singular(struct v4l2_fh *fh);
/*
* Helper function with struct file as argument. If filp->private_data is
* NULL, then it will return 0.
*/
static inline int v4l2_fh_is_singular_file(struct file *filp)
{
return v4l2_fh_is_singular(filp->private_data);
}

#endif /* V4L2_EVENT_H */

0 comments on commit c765b74

Please sign in to comment.