summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-07-06 20:35:23 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-07-19 08:28:18 +0200
commit789026265985f3c8d5d2081690cfa24637b1a333 (patch)
tree4f567db8a79bf0e520a91cfdffd1a345ba94d03d /drivers/media
parent03395df3977eba11e2ee9893082aa63fb6bdfc68 (diff)
media: ti-vpe: cal: Avoid function forward declaration
Move the cal_complete_ctx() function earlier in the file to avoid a foward declaration. There is no functional change. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/ti-vpe/cal.c111
1 files changed, 55 insertions, 56 deletions
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index 19425248bd63..88fed930ed50 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -1852,7 +1852,61 @@ static const struct video_device cal_videodev = {
* Initialization and module stuff
* ------------------------------------------------------------------
*/
-static int cal_complete_ctx(struct cal_ctx *ctx);
+
+static int cal_complete_ctx(struct cal_ctx *ctx)
+{
+ struct video_device *vfd;
+ struct vb2_queue *q;
+ int ret;
+
+ ctx->timeperframe = tpf_default;
+ ctx->external_rate = 192000000;
+
+ /* initialize locks */
+ spin_lock_init(&ctx->slock);
+ mutex_init(&ctx->mutex);
+
+ /* initialize queue */
+ q = &ctx->vb_vidq;
+ q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ q->io_modes = VB2_MMAP | VB2_DMABUF | VB2_READ;
+ q->drv_priv = ctx;
+ q->buf_struct_size = sizeof(struct cal_buffer);
+ q->ops = &cal_video_qops;
+ q->mem_ops = &vb2_dma_contig_memops;
+ q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
+ q->lock = &ctx->mutex;
+ q->min_buffers_needed = 3;
+ q->dev = ctx->v4l2_dev.dev;
+
+ ret = vb2_queue_init(q);
+ if (ret)
+ return ret;
+
+ /* init video dma queues */
+ INIT_LIST_HEAD(&ctx->vidq.active);
+
+ vfd = &ctx->vdev;
+ *vfd = cal_videodev;
+ vfd->v4l2_dev = &ctx->v4l2_dev;
+ vfd->queue = q;
+
+ /*
+ * Provide a mutex to v4l2 core. It will be used to protect
+ * all fops and v4l2 ioctls.
+ */
+ vfd->lock = &ctx->mutex;
+ video_set_drvdata(vfd, ctx);
+
+ ret = video_register_device(vfd, VFL_TYPE_VIDEO, video_nr);
+ if (ret < 0)
+ return ret;
+
+ v4l2_info(&ctx->v4l2_dev, "V4L2 device registered as %s\n",
+ video_device_node_name(vfd));
+
+ return 0;
+}
static int cal_async_bound(struct v4l2_async_notifier *notifier,
struct v4l2_subdev *subdev,
@@ -1948,61 +2002,6 @@ static const struct v4l2_async_notifier_operations cal_async_ops = {
.complete = cal_async_complete,
};
-static int cal_complete_ctx(struct cal_ctx *ctx)
-{
- struct video_device *vfd;
- struct vb2_queue *q;
- int ret;
-
- ctx->timeperframe = tpf_default;
- ctx->external_rate = 192000000;
-
- /* initialize locks */
- spin_lock_init(&ctx->slock);
- mutex_init(&ctx->mutex);
-
- /* initialize queue */
- q = &ctx->vb_vidq;
- q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- q->io_modes = VB2_MMAP | VB2_DMABUF | VB2_READ;
- q->drv_priv = ctx;
- q->buf_struct_size = sizeof(struct cal_buffer);
- q->ops = &cal_video_qops;
- q->mem_ops = &vb2_dma_contig_memops;
- q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
- q->lock = &ctx->mutex;
- q->min_buffers_needed = 3;
- q->dev = ctx->v4l2_dev.dev;
-
- ret = vb2_queue_init(q);
- if (ret)
- return ret;
-
- /* init video dma queues */
- INIT_LIST_HEAD(&ctx->vidq.active);
-
- vfd = &ctx->vdev;
- *vfd = cal_videodev;
- vfd->v4l2_dev = &ctx->v4l2_dev;
- vfd->queue = q;
-
- /*
- * Provide a mutex to v4l2 core. It will be used to protect
- * all fops and v4l2 ioctls.
- */
- vfd->lock = &ctx->mutex;
- video_set_drvdata(vfd, ctx);
-
- ret = video_register_device(vfd, VFL_TYPE_VIDEO, video_nr);
- if (ret < 0)
- return ret;
-
- v4l2_info(&ctx->v4l2_dev, "V4L2 device registered as %s\n",
- video_device_node_name(vfd));
-
- return 0;
-}
-
static struct device_node *
of_get_next_port(const struct device_node *parent,
struct device_node *prev)