From 0499b2f267962ce5e4c56d9be15f1366a524bb88 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Fri, 20 Apr 2018 04:03:28 +0200
Subject: [PATCH 70/82] media: sun6i-csi: Port to 4.17 - use
 v4l2_g_parm_cap/v4l2_s_parm_cap helpers

Signed-off-by: Ondrej Jirman <megous@megous.com>
---
 drivers/media/platform/sun6i-csi/sun6i_csi.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/media/platform/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sun6i-csi/sun6i_csi.c
index 2bd746c3efc4..3d13e26b2312 100644
--- a/drivers/media/platform/sun6i-csi/sun6i_csi.c
+++ b/drivers/media/platform/sun6i-csi/sun6i_csi.c
@@ -454,21 +454,16 @@ static int sun6i_enum_frameintervals(struct file *file, void *priv,
 	return 0;
 }
 
-
 static int sun6i_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
 {
 	struct sun6i_csi *csi = video_drvdata(file);
 	struct sun6i_csi_subdev *csi_sd;
 
-	if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
-		return -EINVAL;
-
 	csi_sd = sun6i_get_enabled_subdev(csi);
 	if (csi_sd == NULL)
 		return -ENXIO;
 
-	a->parm.capture.readbuffers = 0;
-	return v4l2_subdev_call(csi_sd->sd, video, g_parm, a);
+	return v4l2_g_parm_cap(video_devdata(file), csi_sd->sd, a);
 }
 
 static int sun6i_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
@@ -476,15 +471,11 @@ static int sun6i_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
 	struct sun6i_csi *csi = video_drvdata(file);
 	struct sun6i_csi_subdev *csi_sd;
 
-	if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
-		return -EINVAL;
-
 	csi_sd = sun6i_get_enabled_subdev(csi);
 	if (csi_sd == NULL)
 		return -ENXIO;
 
-	a->parm.capture.readbuffers = 0;
-	return v4l2_subdev_call(csi_sd->sd, video, s_parm, a);
+	return v4l2_g_parm_cap(video_devdata(file), csi_sd->sd, a);
 }
 
 static int sun6i_enum_input(struct file *file, void *priv,
-- 
2.20.1

