[media] media: mx2_camera: fix const cropping related warnings
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Fri, 28 Sep 2012 10:46:52 +0000 (07:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 22 Nov 2012 12:45:13 +0000 (10:45 -0200)
A recent commit "[media] v4l2: make vidioc_s_crop const" introduced
warnings in mx2_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/mx2_camera.c

index 9fd9d1c5b218a5b51ff0522b9969db06e795706c..f36b362aff6910b182d24b9daf8d7fa974e0cc3f 100644 (file)
@@ -1099,9 +1099,10 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
 }
 
 static int mx2_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 v4l2_subdev *sd = soc_camera_to_subdev(icd);
        struct v4l2_mbus_framefmt mf;
        int ret;