Merge tag 'gcc-plugins-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / drivers / media / platform / vsp1 / vsp1_hsit.c
index 6e5077b..94316af 100644 (file)
@@ -71,10 +71,15 @@ static int hsit_set_format(struct v4l2_subdev *subdev,
        struct vsp1_hsit *hsit = to_hsit(subdev);
        struct v4l2_subdev_pad_config *config;
        struct v4l2_mbus_framefmt *format;
+       int ret = 0;
+
+       mutex_lock(&hsit->entity.lock);
 
        config = vsp1_entity_get_pad_config(&hsit->entity, cfg, fmt->which);
-       if (!config)
-               return -EINVAL;
+       if (!config) {
+               ret = -EINVAL;
+               goto done;
+       }
 
        format = vsp1_entity_get_pad_format(&hsit->entity, config, fmt->pad);
 
@@ -83,7 +88,7 @@ static int hsit_set_format(struct v4l2_subdev *subdev,
                 * modified.
                 */
                fmt->format = *format;
-               return 0;
+               goto done;
        }
 
        format->code = hsit->inverse ? MEDIA_BUS_FMT_AHSV8888_1X32
@@ -104,7 +109,9 @@ static int hsit_set_format(struct v4l2_subdev *subdev,
        format->code = hsit->inverse ? MEDIA_BUS_FMT_ARGB8888_1X32
                     : MEDIA_BUS_FMT_AHSV8888_1X32;
 
-       return 0;
+done:
+       mutex_unlock(&hsit->entity.lock);
+       return ret;
 }
 
 static const struct v4l2_subdev_pad_ops hsit_pad_ops = {
@@ -125,11 +132,12 @@ static const struct v4l2_subdev_ops hsit_ops = {
 
 static void hsit_configure(struct vsp1_entity *entity,
                           struct vsp1_pipeline *pipe,
-                          struct vsp1_dl_list *dl, bool full)
+                          struct vsp1_dl_list *dl,
+                          enum vsp1_entity_params params)
 {
        struct vsp1_hsit *hsit = to_hsit(&entity->subdev);
 
-       if (!full)
+       if (params != VSP1_ENTITY_PARAMS_INIT)
                return;
 
        if (hsit->inverse)