From e5fd91f1ef340da553f7a79da9540c3db711c937 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Tue, 8 Sep 2015 01:01:14 -0300 Subject: Linux-libre 4.2-gnu --- drivers/media/platform/s3c-camif/camif-capture.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'drivers/media/platform/s3c-camif/camif-capture.c') diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c index f6a61b9ce..76e6289a5 100644 --- a/drivers/media/platform/s3c-camif/camif-capture.c +++ b/drivers/media/platform/s3c-camif/camif-capture.c @@ -115,7 +115,7 @@ static int sensor_set_power(struct camif_dev *camif, int on) struct cam_sensor *sensor = &camif->sensor; int err = 0; - if (!on == camif->sensor.power_count) + if (camif->sensor.power_count == !on) err = v4l2_subdev_call(sensor->sd, core, s_power, on); if (!err) sensor->power_count += on ? 1 : -1; @@ -131,7 +131,7 @@ static int sensor_set_streaming(struct camif_dev *camif, int on) struct cam_sensor *sensor = &camif->sensor; int err = 0; - if (!on == camif->sensor.stream_count) + if (camif->sensor.stream_count == !on) err = v4l2_subdev_call(sensor->sd, video, s_stream, on); if (!err) sensor->stream_count += on ? 1 : -1; @@ -449,19 +449,22 @@ static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt, struct camif_vp *vp = vb2_get_drv_priv(vq); struct camif_dev *camif = vp->camif; struct camif_frame *frame = &vp->out_frame; - const struct camif_fmt *fmt = vp->out_fmt; + const struct camif_fmt *fmt; unsigned int size; if (pfmt) { pix = &pfmt->fmt.pix; fmt = s3c_camif_find_format(vp, &pix->pixelformat, -1); + if (fmt == NULL) + return -EINVAL; size = (pix->width * pix->height * fmt->depth) / 8; } else { + fmt = vp->out_fmt; + if (fmt == NULL) + return -EINVAL; size = (frame->f_width * frame->f_height * fmt->depth) / 8; } - if (fmt == NULL) - return -EINVAL; *num_planes = 1; if (pix) -- cgit v1.2.3-54-g00ecf