These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / media / omap4iss / iss_ipipe.c
index eaa82da..dd0abef 100644 (file)
 #include "iss_ipipe.h"
 
 static struct v4l2_mbus_framefmt *
-__ipipe_get_format(struct iss_ipipe_device *ipipe, struct v4l2_subdev_pad_config *cfg,
-                 unsigned int pad, enum v4l2_subdev_format_whence which);
+__ipipe_get_format(struct iss_ipipe_device *ipipe,
+                  struct v4l2_subdev_pad_config *cfg,
+                  unsigned int pad,
+                  enum v4l2_subdev_format_whence which);
 
 static const unsigned int ipipe_fmts[] = {
        MEDIA_BUS_FMT_SGRBG10_1X10,
@@ -176,8 +178,10 @@ static int ipipe_set_stream(struct v4l2_subdev *sd, int enable)
 }
 
 static struct v4l2_mbus_framefmt *
-__ipipe_get_format(struct iss_ipipe_device *ipipe, struct v4l2_subdev_pad_config *cfg,
-                 unsigned int pad, enum v4l2_subdev_format_whence which)
+__ipipe_get_format(struct iss_ipipe_device *ipipe,
+                  struct v4l2_subdev_pad_config *cfg,
+                  unsigned int pad,
+                  enum v4l2_subdev_format_whence which)
 {
        if (which == V4L2_SUBDEV_FORMAT_TRY)
                return v4l2_subdev_get_try_format(&ipipe->subdev, cfg, pad);
@@ -193,9 +197,11 @@ __ipipe_get_format(struct iss_ipipe_device *ipipe, struct v4l2_subdev_pad_config
  * @fmt: Format
  */
 static void
-ipipe_try_format(struct iss_ipipe_device *ipipe, struct v4l2_subdev_pad_config *cfg,
-               unsigned int pad, struct v4l2_mbus_framefmt *fmt,
-               enum v4l2_subdev_format_whence which)
+ipipe_try_format(struct iss_ipipe_device *ipipe,
+                struct v4l2_subdev_pad_config *cfg,
+                unsigned int pad,
+                struct v4l2_mbus_framefmt *fmt,
+                enum v4l2_subdev_format_whence which)
 {
        struct v4l2_mbus_framefmt *format;
        unsigned int width = fmt->width;
@@ -241,8 +247,8 @@ ipipe_try_format(struct iss_ipipe_device *ipipe, struct v4l2_subdev_pad_config *
  * return -EINVAL or zero on success
  */
 static int ipipe_enum_mbus_code(struct v4l2_subdev *sd,
-                              struct v4l2_subdev_pad_config *cfg,
-                              struct v4l2_subdev_mbus_code_enum *code)
+                               struct v4l2_subdev_pad_config *cfg,
+                               struct v4l2_subdev_mbus_code_enum *code)
 {
        switch (code->pad) {
        case IPIPE_PAD_SINK:
@@ -268,8 +274,8 @@ static int ipipe_enum_mbus_code(struct v4l2_subdev *sd,
 }
 
 static int ipipe_enum_frame_size(struct v4l2_subdev *sd,
-                               struct v4l2_subdev_pad_config *cfg,
-                               struct v4l2_subdev_frame_size_enum *fse)
+                                struct v4l2_subdev_pad_config *cfg,
+                                struct v4l2_subdev_frame_size_enum *fse)
 {
        struct iss_ipipe_device *ipipe = v4l2_get_subdevdata(sd);
        struct v4l2_mbus_framefmt format;
@@ -306,14 +312,15 @@ static int ipipe_enum_frame_size(struct v4l2_subdev *sd,
  * Return 0 on success or -EINVAL if the pad is invalid or doesn't correspond
  * to the format type.
  */
-static int ipipe_get_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg,
-                          struct v4l2_subdev_format *fmt)
+static int ipipe_get_format(struct v4l2_subdev *sd,
+                           struct v4l2_subdev_pad_config *cfg,
+                           struct v4l2_subdev_format *fmt)
 {
        struct iss_ipipe_device *ipipe = v4l2_get_subdevdata(sd);
        struct v4l2_mbus_framefmt *format;
 
        format = __ipipe_get_format(ipipe, cfg, fmt->pad, fmt->which);
-       if (format == NULL)
+       if (!format)
                return -EINVAL;
 
        fmt->format = *format;
@@ -329,14 +336,15 @@ static int ipipe_get_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_confi
  * Return 0 on success or -EINVAL if the pad is invalid or doesn't correspond
  * to the format type.
  */
-static int ipipe_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg,
-                          struct v4l2_subdev_format *fmt)
+static int ipipe_set_format(struct v4l2_subdev *sd,
+                           struct v4l2_subdev_pad_config *cfg,
+                           struct v4l2_subdev_format *fmt)
 {
        struct iss_ipipe_device *ipipe = v4l2_get_subdevdata(sd);
        struct v4l2_mbus_framefmt *format;
 
        format = __ipipe_get_format(ipipe, cfg, fmt->pad, fmt->which);
-       if (format == NULL)
+       if (!format)
                return -EINVAL;
 
        ipipe_try_format(ipipe, cfg, fmt->pad, &fmt->format, fmt->which);
@@ -345,18 +353,18 @@ static int ipipe_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_confi
        /* Propagate the format from sink to source */
        if (fmt->pad == IPIPE_PAD_SINK) {
                format = __ipipe_get_format(ipipe, cfg, IPIPE_PAD_SOURCE_VP,
-                                          fmt->which);
+                                           fmt->which);
                *format = fmt->format;
                ipipe_try_format(ipipe, cfg, IPIPE_PAD_SOURCE_VP, format,
-                               fmt->which);
+                                fmt->which);
        }
 
        return 0;
 }
 
 static int ipipe_link_validate(struct v4l2_subdev *sd, struct media_link *link,
-                                struct v4l2_subdev_format *source_fmt,
-                                struct v4l2_subdev_format *sink_fmt)
+                              struct v4l2_subdev_format *source_fmt,
+                              struct v4l2_subdev_format *sink_fmt)
 {
        /* Check if the two ends match */
        if (source_fmt->format.width != sink_fmt->format.width ||
@@ -432,8 +440,8 @@ static const struct v4l2_subdev_internal_ops ipipe_v4l2_internal_ops = {
  * return -EINVAL or zero on success
  */
 static int ipipe_link_setup(struct media_entity *entity,
-                          const struct media_pad *local,
-                          const struct media_pad *remote, u32 flags)
+                           const struct media_pad *local,
+                           const struct media_pad *remote, u32 flags)
 {
        struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
        struct iss_ipipe_device *ipipe = v4l2_get_subdevdata(sd);
@@ -520,7 +528,7 @@ void omap4iss_ipipe_unregister_entities(struct iss_ipipe_device *ipipe)
 }
 
 int omap4iss_ipipe_register_entities(struct iss_ipipe_device *ipipe,
-       struct v4l2_device *vdev)
+                                    struct v4l2_device *vdev)
 {
        int ret;