CHROMIUM: v4l2-ctrls: fix s_ext_ctrls error when passing non-zero ctrl_class
authorJeffy Chen <jeffy.chen@rock-chips.com>
Thu, 21 Jul 2016 02:38:51 +0000 (10:38 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Thu, 21 Jul 2016 08:06:03 +0000 (16:06 +0800)
due to a merge mistake in I3b80a31681765836a134812ebc56686324ca5194.

Change-Id: Iad2914518997b664704f2c2933c8327fc4252bbb
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
drivers/media/v4l2-core/v4l2-ctrls.c

index cc8164c0e7c78a02faa2dd3a2bb622e6c2d6037c..f82434e178e17b4fc498178fb05da774849c86ee 100644 (file)
@@ -2801,6 +2801,7 @@ static int prepare_ext_ctrls(struct v4l2_ctrl_handler *hdl,
                             struct v4l2_ctrl_helper *helpers,
                             bool get)
 {
+       u32 which = V4L2_CTRL_ID2WHICH(cs->which);
        unsigned store = cs->config_store & 0xffff;
        struct v4l2_ctrl_helper *h;
        bool have_clusters = false;
@@ -2814,7 +2815,7 @@ static int prepare_ext_ctrls(struct v4l2_ctrl_handler *hdl,
 
                cs->error_idx = i;
 
-               if (cs->which && V4L2_CTRL_ID2WHICH(id) != cs->which)
+               if (which && V4L2_CTRL_ID2WHICH(id) != cs->which)
                        return -EINVAL;
 
                /* Old-style private controls are not allowed for