[media] media: mem2mem: make reference to struct m2m_ops in the core const
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Tue, 11 Sep 2012 09:32:17 +0000 (06:32 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 Dec 2012 15:35:18 +0000 (13:35 -0200)
The mem2mem core doesn't change struct m2m_ops, provided by the driver,
make references to it const.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/v4l2-core/v4l2-mem2mem.c
include/media/v4l2-mem2mem.h

index 438ea45d10749750a2941474265b0e72ea75f239..da99cf7271622bcde65495426686fc00e7beec02 100644 (file)
@@ -62,7 +62,7 @@ struct v4l2_m2m_dev {
        struct list_head        job_queue;
        spinlock_t              job_spinlock;
 
-       struct v4l2_m2m_ops     *m2m_ops;
+       const struct v4l2_m2m_ops *m2m_ops;
 };
 
 static struct v4l2_m2m_queue_ctx *get_queue_ctx(struct v4l2_m2m_ctx *m2m_ctx,
@@ -519,7 +519,7 @@ EXPORT_SYMBOL(v4l2_m2m_mmap);
  *
  * Usually called from driver's probe() function.
  */
-struct v4l2_m2m_dev *v4l2_m2m_init(struct v4l2_m2m_ops *m2m_ops)
+struct v4l2_m2m_dev *v4l2_m2m_init(const struct v4l2_m2m_ops *m2m_ops)
 {
        struct v4l2_m2m_dev *m2m_dev;
 
index 7e82d2b193d5625702594fe59f1484e1b09c3d06..d3eef01da648d49387d6efe41bb2cae66bd6dac6 100644 (file)
@@ -125,7 +125,7 @@ unsigned int v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
 int v4l2_m2m_mmap(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
                  struct vm_area_struct *vma);
 
-struct v4l2_m2m_dev *v4l2_m2m_init(struct v4l2_m2m_ops *m2m_ops);
+struct v4l2_m2m_dev *v4l2_m2m_init(const struct v4l2_m2m_ops *m2m_ops);
 void v4l2_m2m_release(struct v4l2_m2m_dev *m2m_dev);
 
 struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(struct v4l2_m2m_dev *m2m_dev,