]> Pileus Git - ~andy/linux/commitdiff
[media] media: mx3_camera: fix const cropping related warnings
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Fri, 28 Sep 2012 10:39:06 +0000 (07:39 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 22 Nov 2012 12:44:56 +0000 (10:44 -0200)
A recent commit "[media] v4l2: make vidioc_s_crop const" introduced
warnings in mx3_camera. Fix them by cleanly separating writable and
read-only variables in cropping operations.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/soc_camera/mx3_camera.c

index 3557ac97e4303f4743330850a5144f43cb06cbd0..261f6e9e1b176dcbc543992204162673f06935c4 100644 (file)
@@ -799,9 +799,10 @@ static inline void stride_align(__u32 *width)
  * default g_crop and cropcap from soc_camera.c
  */
 static int mx3_camera_set_crop(struct soc_camera_device *icd,
-                              struct v4l2_crop *a)
+                              const struct v4l2_crop *a)
 {
-       struct v4l2_rect *rect = &a->c;
+       struct v4l2_crop a_writable = *a;
+       struct v4l2_rect *rect = &a_writable.c;
        struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
        struct mx3_camera_dev *mx3_cam = ici->priv;
        struct v4l2_subdev *sd = soc_camera_to_subdev(icd);