summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>2020-02-07 11:59:49 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-02-24 19:42:07 +0300
commit129f757cd0ec3268820e20687009c97915fe1182 (patch)
tree4873ec586075ed44397f09294530d4a64068880f /drivers
parent0966f4e5a8a2acc9c1b7aaaa4e8b35bf947a53cd (diff)
downloadlinux-129f757cd0ec3268820e20687009c97915fe1182.tar.xz
media: staging: rkisp1: isp: check for dphy bus before initializations in s_stream
In rkisp1_isp_s_stream it is better to return error in case the bus type is not dphy before initializing the registers. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Acked-by: Helen Koike <helen.koike@collabora.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/media/rkisp1/rkisp1-isp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/media/rkisp1/rkisp1-isp.c b/drivers/staging/media/rkisp1/rkisp1-isp.c
index 5ff4475032ae..9ad02bba14c0 100644
--- a/drivers/staging/media/rkisp1/rkisp1-isp.c
+++ b/drivers/staging/media/rkisp1/rkisp1-isp.c
@@ -947,14 +947,14 @@ static int rkisp1_isp_s_stream(struct v4l2_subdev *sd, int enable)
rkisp1->active_sensor = container_of(sensor_sd->asd,
struct rkisp1_sensor_async, asd);
+ if (rkisp1->active_sensor->mbus.type != V4L2_MBUS_CSI2_DPHY)
+ return -EINVAL;
+
atomic_set(&rkisp1->isp.frame_sequence, -1);
ret = rkisp1_config_cif(rkisp1);
if (ret)
return ret;
- if (rkisp1->active_sensor->mbus.type != V4L2_MBUS_CSI2_DPHY)
- return -EINVAL;
-
ret = rkisp1_mipi_csi2_start(&rkisp1->isp, rkisp1->active_sensor);
if (ret)
return ret;