[media] media: mx2_camera: Don't modify non volatile parameters in try_fmt
authorJavier Martin <javier.martin@vista-silicon.com>
Mon, 20 Aug 2012 09:49:24 +0000 (06:49 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 6 Oct 2012 12:11:54 +0000 (09:11 -0300)
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
[g.liakhovetski@gmx.de: also don't clear pcdev->resizing in .try_fmt()]
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 403d7f17bfab1277adba82ed59d0650f99dd16aa..8d2587137d3bb9845c6e932194c583ac901638dd 100644 (file)
@@ -1376,6 +1376,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
        __u32 pixfmt = pix->pixelformat;
        struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
        struct mx2_camera_dev *pcdev = ici->priv;
+       struct mx2_fmt_cfg *emma_prp;
        unsigned int width_limit;
        int ret;
 
@@ -1438,12 +1439,11 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
                __func__, pcdev->s_width, pcdev->s_height);
 
        /* If the sensor does not support image size try PrP resizing */
-       pcdev->emma_prp = mx27_emma_prp_get_format(xlate->code,
+       emma_prp = mx27_emma_prp_get_format(xlate->code,
                                                   xlate->host_fmt->fourcc);
 
-       memset(pcdev->resizing, 0, sizeof(pcdev->resizing));
        if ((mf.width != pix->width || mf.height != pix->height) &&
-               pcdev->emma_prp->cfg.in_fmt == PRP_CNTL_DATA_IN_YUV422) {
+               emma_prp->cfg.in_fmt == PRP_CNTL_DATA_IN_YUV422) {
                if (mx2_emmaprp_resize(pcdev, &mf, pix, false) < 0)
                        dev_dbg(icd->parent, "%s: can't resize\n", __func__);
        }