v4l2_fh_add(&handle->vfh);
handle->chain = stream->chain;
handle->stream = stream;
- file->private_data = handle;
+ file->private_data = &handle->vfh;
return 0;
}
static int uvc_v4l2_release(struct file *file)
{
- struct uvc_fh *handle = file->private_data;
+ struct uvc_fh *handle = to_uvc_fh(file);
struct uvc_streaming *stream = handle->stream;
uvc_dbg(stream->dev, CALLS, "%s\n", __func__);
static int uvc_ioctl_querycap(struct file *file, void *fh,
struct v4l2_capability *cap)
{
- struct uvc_fh *handle = file->private_data;
+ struct uvc_fh *handle = to_uvc_fh(file);
struct uvc_video_chain *chain = handle->chain;
struct uvc_streaming *stream = handle->stream;
static long uvc_v4l2_compat_ioctl32(struct file *file,
unsigned int cmd, unsigned long arg)
{
- struct uvc_fh *handle = file->private_data;
+ struct uvc_fh *handle = to_uvc_fh(file);
union {
struct uvc_xu_control_mapping xmap;
struct uvc_xu_control_query xqry;
static long uvc_v4l2_unlocked_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
- struct uvc_fh *handle = file->private_data;
+ struct uvc_fh *handle = to_uvc_fh(file);
unsigned int converted_cmd = v4l2_translate_cmd(cmd);
int ret;
unsigned int pending_async_ctrls;
};
+static inline struct uvc_fh *to_uvc_fh(struct file *filp)
+{
+ return container_of(filp->private_data, struct uvc_fh, vfh);
+}
+
/* ------------------------------------------------------------------------
* Debugging, printing and logging
*/