[media] cx18: use core priority handling
authorHans Verkuil <hverkuil@xs4all.nl>
Sat, 12 Mar 2011 09:36:08 +0000 (06:36 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 22 Mar 2011 19:38:04 +0000 (16:38 -0300)
VIDIOC_S/G_PRIORITY handling is now done by the v4l2 core framework.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx18/cx18-driver.h
drivers/media/video/cx18/cx18-fileops.c
drivers/media/video/cx18/cx18-ioctl.c

index 30a8574..b86a740 100644 (file)
@@ -409,7 +409,6 @@ struct cx18_open_id {
        struct v4l2_fh fh;
        u32 open_id;
        int type;
-       enum v4l2_priority prio;
        struct cx18 *cx;
 };
 
@@ -605,7 +604,6 @@ struct cx18 {
                                   uninitialized value in the stream->id. */
 
        u32 base_addr;
-       struct v4l2_prio_state prio;
 
        u8 card_rev;
        void __iomem *enc_mem, *reg_mem;
index 1172d68..e9802d9 100644 (file)
@@ -683,7 +683,6 @@ int cx18_v4l2_close(struct file *filp)
 
        CX18_DEBUG_IOCTL("close() of %s\n", s->name);
 
-       v4l2_prio_close(&cx->prio, id->prio);
        v4l2_fh_del(fh);
        v4l2_fh_exit(fh);
 
@@ -740,7 +739,6 @@ static int cx18_serialized_open(struct cx18_stream *s, struct file *filp)
 
        item->cx = cx;
        item->type = s->type;
-       v4l2_prio_open(&cx->prio, &item->prio);
 
        item->open_id = cx->open_id++;
        filp->private_data = &item->fh;
index 6624ec2..86c30b9 100644 (file)
@@ -277,10 +277,6 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
        int ret;
        int w, h;
 
-       ret = v4l2_prio_check(&cx->prio, id->prio);
-       if (ret)
-               return ret;
-
        ret = cx18_try_fmt_vid_cap(file, fh, fmt);
        if (ret)
                return ret;
@@ -307,10 +303,6 @@ static int cx18_s_fmt_vbi_cap(struct file *file, void *fh,
        struct cx18 *cx = id->cx;
        int ret;
 
-       ret = v4l2_prio_check(&cx->prio, id->prio);
-       if (ret)
-               return ret;
-
        /*
         * Changing the Encoder's Raw VBI parameters won't have any effect
         * if any analog capture is ongoing
@@ -342,10 +334,6 @@ static int cx18_s_fmt_sliced_vbi_cap(struct file *file, void *fh,
        int ret;
        struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced;
 
-       ret = v4l2_prio_check(&cx->prio, id->prio);
-       if (ret)
-               return ret;
-
        cx18_try_fmt_sliced_vbi_cap(file, fh, fmt);
 
        /*
@@ -464,22 +452,6 @@ static int cx18_s_register(struct file *file, void *fh,
 }
 #endif
 
-static int cx18_g_priority(struct file *file, void *fh, enum v4l2_priority *p)
-{
-       struct cx18 *cx = file2id(file)->cx;
-
-       *p = v4l2_prio_max(&cx->prio);
-       return 0;
-}
-
-static int cx18_s_priority(struct file *file, void *fh, enum v4l2_priority prio)
-{
-       struct cx18_open_id *id = file2id(file);
-       struct cx18 *cx = id->cx;
-
-       return v4l2_prio_change(&cx->prio, &id->prio, prio);
-}
-
 static int cx18_querycap(struct file *file, void *fh,
                                struct v4l2_capability *vcap)
 {
@@ -548,11 +520,6 @@ static int cx18_s_crop(struct file *file, void *fh, struct v4l2_crop *crop)
 {
        struct cx18_open_id *id = fh2id(fh);
        struct cx18 *cx = id->cx;
-       int ret;
-
-       ret = v4l2_prio_check(&cx->prio, id->prio);
-       if (ret)
-               return ret;
 
        if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
                return -EINVAL;
@@ -600,11 +567,6 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp)
 {
        struct cx18_open_id *id = fh2id(fh);
        struct cx18 *cx = id->cx;
-       int ret;
-
-       ret = v4l2_prio_check(&cx->prio, id->prio);
-       if (ret)
-               return ret;
 
        if (inp >= cx->nof_inputs)
                return -EINVAL;
@@ -646,11 +608,6 @@ int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
 {
        struct cx18_open_id *id = fh2id(fh);
        struct cx18 *cx = id->cx;
-       int ret;
-
-       ret = v4l2_prio_check(&cx->prio, id->prio);
-       if (ret)
-               return ret;
 
        if (vf->tuner != 0)
                return -EINVAL;
@@ -674,11 +631,6 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
 {
        struct cx18_open_id *id = fh2id(fh);
        struct cx18 *cx = id->cx;
-       int ret;
-
-       ret = v4l2_prio_check(&cx->prio, id->prio);
-       if (ret)
-               return ret;
 
        if ((*std & V4L2_STD_ALL) == 0)
                return -EINVAL;
@@ -715,11 +667,6 @@ static int cx18_s_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
 {
        struct cx18_open_id *id = fh2id(fh);
        struct cx18 *cx = id->cx;
-       int ret;
-
-       ret = v4l2_prio_check(&cx->prio, id->prio);
-       if (ret)
-               return ret;
 
        if (vt->index != 0)
                return -EINVAL;
@@ -1088,8 +1035,6 @@ long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
 
        mutex_lock(&cx->serialize_lock);
 
-       /* FIXME - consolidate v4l2_prio_check()'s here */
-
        if (cx18_debug & CX18_DBGFLG_IOCTL)
                vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
        res = video_ioctl2(filp, cmd, arg);
@@ -1100,8 +1045,6 @@ long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
 
 static const struct v4l2_ioctl_ops cx18_ioctl_ops = {
        .vidioc_querycap                = cx18_querycap,
-       .vidioc_g_priority              = cx18_g_priority,
-       .vidioc_s_priority              = cx18_s_priority,
        .vidioc_s_audio                 = cx18_s_audio,
        .vidioc_g_audio                 = cx18_g_audio,
        .vidioc_enumaudio               = cx18_enumaudio,