u32 offs;
};
+static inline struct comp_fh *to_comp_fh(struct file *filp)
+{
+ return container_of(filp->private_data, struct comp_fh, fh);
+}
+
static LIST_HEAD(video_devices);
static DEFINE_SPINLOCK(list_lock);
fh->mdev = mdev;
v4l2_fh_init(&fh->fh, vdev);
- filp->private_data = fh;
+ filp->private_data = &fh->fh;
v4l2_fh_add(&fh->fh);
static int comp_vdev_close(struct file *filp)
{
- struct comp_fh *fh = filp->private_data;
+ struct comp_fh *fh = to_comp_fh(filp);
struct most_video_dev *mdev = fh->mdev;
struct mbo *mbo, *tmp;
static ssize_t comp_vdev_read(struct file *filp, char __user *buf,
size_t count, loff_t *pos)
{
- struct comp_fh *fh = filp->private_data;
+ struct comp_fh *fh = to_comp_fh(filp);
struct most_video_dev *mdev = fh->mdev;
int ret = 0;
static __poll_t comp_vdev_poll(struct file *filp, poll_table *wait)
{
- struct comp_fh *fh = filp->private_data;
+ struct comp_fh *fh = to_comp_fh(filp);
struct most_video_dev *mdev = fh->mdev;
__poll_t mask = 0;