[media] pwc: Fix pixfmt handling

Before this patch various code in the mode setting patch checked
pdev->pixfmt, but that was not set until the mode setting succeeded, so
it was looking at the old pixfmt! This patch fixes this by making the
pixfmt a parameter to set_video_mode, and setting it from set_video_mode
on success.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/video/pwc/pwc-v4l.c b/drivers/media/video/pwc/pwc-v4l.c
index ef422d0..b275fad 100644
--- a/drivers/media/video/pwc/pwc-v4l.c
+++ b/drivers/media/video/pwc/pwc-v4l.c
@@ -493,16 +493,11 @@
 			(pixelformat>>24)&255);
 
 	ret = pwc_set_video_mode(pdev, f->fmt.pix.width, f->fmt.pix.height,
-				 30, &compression);
+				 pixelformat, 30, &compression);
 
 	PWC_DEBUG_IOCTL("pwc_set_video_mode(), return=%d\n", ret);
 
-	if (ret == 0) {
-		pdev->pixfmt = pixelformat;
-		pwc_vidioc_fill_fmt(f, pdev->width, pdev->height,
-				    pdev->pixfmt);
-	}
-
+	pwc_vidioc_fill_fmt(f, pdev->width, pdev->height, pdev->pixfmt);
 leave:
 	mutex_unlock(&pdev->udevlock);
 	return ret;
@@ -1141,8 +1136,8 @@
 		goto leave;
 	}
 
-	ret = pwc_set_video_mode(pdev, pdev->width, pdev->height, fps,
-				 &compression);
+	ret = pwc_set_video_mode(pdev, pdev->width, pdev->height, pdev->pixfmt,
+				 fps, &compression);
 
 	pwc_g_parm(file, fh, parm);