]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/pxa_camera.c
Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel
[linux-2.6-omap-h63xx.git] / drivers / media / video / pxa_camera.c
index e3e6b29ea6d2cb7bf21796d1f7a8a2e464dd2aa0..0c4ce58c53d53363afa9e7371a2e868b90dc34b5 100644 (file)
@@ -1154,23 +1154,23 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd,
 {
        struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
        struct pxa_camera_dev *pcdev = ici->priv;
-       const struct soc_camera_data_format *host_fmt, *cam_fmt = NULL;
-       const struct soc_camera_format_xlate *xlate;
+       const struct soc_camera_data_format *cam_fmt = NULL;
+       const struct soc_camera_format_xlate *xlate = NULL;
        struct soc_camera_sense sense = {
                .master_clock = pcdev->mclk,
                .pixel_clock_max = pcdev->ciclk / 4,
        };
-       int ret, buswidth;
+       int ret;
 
-       xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
-       if (!xlate) {
-               dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
-               return -EINVAL;
-       }
+       if (pixfmt) {
+               xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
+               if (!xlate) {
+                       dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
+                       return -EINVAL;
+               }
 
-       buswidth = xlate->buswidth;
-       host_fmt = xlate->host_fmt;
-       cam_fmt = xlate->cam_fmt;
+               cam_fmt = xlate->cam_fmt;
+       }
 
        /* If PCLK is used to latch data from the sensor, check sense */
        if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN)
@@ -1200,8 +1200,8 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd,
        }
 
        if (pixfmt && !ret) {
-               icd->buswidth = buswidth;
-               icd->current_fmt = host_fmt;
+               icd->buswidth = xlate->buswidth;
+               icd->current_fmt = xlate->host_fmt;
        }
 
        return ret;