UPSTREAM: [media] media/core: Replace ctrl_class with which
[firefly-linux-kernel-4.4.55.git] / drivers / media / v4l2-core / v4l2-ioctl.c
index 7486af2c8ae49241d3aafd3c30f1a90094a63a0f..8a018c6dd16a8eff5812af61368c26054a3ed3b1 100644 (file)
@@ -565,8 +565,8 @@ static void v4l_print_ext_controls(const void *arg, bool write_only)
        const struct v4l2_ext_controls *p = arg;
        int i;
 
-       pr_cont("class=0x%x, count=%d, error_idx=%d",
-                       p->ctrl_class, p->count, p->error_idx);
+       pr_cont("which=0x%x, count=%d, error_idx=%d",
+                       p->which, p->count, p->error_idx);
        for (i = 0; i < p->count; i++) {
                if (!p->controls[i].size)
                        pr_cont(", id/val=0x%x/0x%x",
@@ -902,13 +902,13 @@ static int check_ext_ctrls(struct v4l2_ext_controls *c, int allow_priv)
           Only when passed in through VIDIOC_G_CTRL and VIDIOC_S_CTRL
           is it allowed for backwards compatibility.
         */
-       if (!allow_priv && c->ctrl_class == V4L2_CID_PRIVATE_BASE)
+       if (!allow_priv && c->which == V4L2_CID_PRIVATE_BASE)
                return 0;
-       if (c->ctrl_class == 0)
+       if (!c->which)
                return 1;
        /* Check that all controls are from the same control class. */
        for (i = 0; i < c->count; i++) {
-               if (V4L2_CTRL_ID2CLASS(c->controls[i].id) != c->ctrl_class) {
+               if (V4L2_CTRL_ID2WHICH(c->controls[i].id) != c->which) {
                        c->error_idx = i;
                        return 0;
                }
@@ -1969,7 +1969,7 @@ static int v4l_g_ctrl(const struct v4l2_ioctl_ops *ops,
        if (ops->vidioc_g_ext_ctrls == NULL)
                return -ENOTTY;
 
-       ctrls.ctrl_class = V4L2_CTRL_ID2CLASS(p->id);
+       ctrls.which = V4L2_CTRL_ID2WHICH(p->id);
        ctrls.count = 1;
        ctrls.controls = &ctrl;
        ctrl.id = p->id;
@@ -2003,7 +2003,7 @@ static int v4l_s_ctrl(const struct v4l2_ioctl_ops *ops,
        if (ops->vidioc_s_ext_ctrls == NULL)
                return -ENOTTY;
 
-       ctrls.ctrl_class = V4L2_CTRL_ID2CLASS(p->id);
+       ctrls.which = V4L2_CTRL_ID2WHICH(p->id);
        ctrls.count = 1;
        ctrls.controls = &ctrl;
        ctrl.id = p->id;