aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/ivtv/ivtv-ioctl.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-03-15 05:10:40 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-24 05:47:00 -0400
commit314527acbbb3f33f72c2ef19d8cfabcada9912a5 (patch)
tree871021b9e888444f9f71f5c12ecf0272d77fdf8d /drivers/media/pci/ivtv/ivtv-ioctl.c
parent2f73c7c582a685b3198b974cd6d964d0338f8ab5 (diff)
[media] v4l2: pass std by value to the write-only s_std ioctl
This ioctl is defined as IOW, so pass the argument by value instead of by reference. I could have chosen to add const instead, but this is 1) easier to handle in drivers and 2) consistent with the s_std subdev operation. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Jonathan Corbet <corbet@lwn.net> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/pci/ivtv/ivtv-ioctl.c')
-rw-r--r--drivers/media/pci/ivtv/ivtv-ioctl.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c
index 852f11e0d636..080f179070a6 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.c
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
@@ -1103,10 +1103,10 @@ static int ivtv_g_std(struct file *file, void *fh, v4l2_std_id *std)
1103 return 0; 1103 return 0;
1104} 1104}
1105 1105
1106void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id *std) 1106void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id std)
1107{ 1107{
1108 itv->std = *std; 1108 itv->std = std;
1109 itv->is_60hz = (*std & V4L2_STD_525_60) ? 1 : 0; 1109 itv->is_60hz = (std & V4L2_STD_525_60) ? 1 : 0;
1110 itv->is_50hz = !itv->is_60hz; 1110 itv->is_50hz = !itv->is_60hz;
1111 cx2341x_handler_set_50hz(&itv->cxhdl, itv->is_50hz); 1111 cx2341x_handler_set_50hz(&itv->cxhdl, itv->is_50hz);
1112 itv->cxhdl.width = 720; 1112 itv->cxhdl.width = 720;
@@ -1122,15 +1122,15 @@ void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id *std)
1122 ivtv_call_all(itv, core, s_std, itv->std); 1122 ivtv_call_all(itv, core, s_std, itv->std);
1123} 1123}
1124 1124
1125void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id *std) 1125void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id std)
1126{ 1126{
1127 struct yuv_playback_info *yi = &itv->yuv_info; 1127 struct yuv_playback_info *yi = &itv->yuv_info;
1128 DEFINE_WAIT(wait); 1128 DEFINE_WAIT(wait);
1129 int f; 1129 int f;
1130 1130
1131 /* set display standard */ 1131 /* set display standard */
1132 itv->std_out = *std; 1132 itv->std_out = std;
1133 itv->is_out_60hz = (*std & V4L2_STD_525_60) ? 1 : 0; 1133 itv->is_out_60hz = (std & V4L2_STD_525_60) ? 1 : 0;
1134 itv->is_out_50hz = !itv->is_out_60hz; 1134 itv->is_out_50hz = !itv->is_out_60hz;
1135 ivtv_call_all(itv, video, s_std_output, itv->std_out); 1135 ivtv_call_all(itv, video, s_std_output, itv->std_out);
1136 1136
@@ -1168,14 +1168,14 @@ void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id *std)
1168 } 1168 }
1169} 1169}
1170 1170
1171static int ivtv_s_std(struct file *file, void *fh, v4l2_std_id *std) 1171static int ivtv_s_std(struct file *file, void *fh, v4l2_std_id std)
1172{ 1172{
1173 struct ivtv *itv = fh2id(fh)->itv; 1173 struct ivtv *itv = fh2id(fh)->itv;
1174 1174
1175 if ((*std & V4L2_STD_ALL) == 0) 1175 if ((std & V4L2_STD_ALL) == 0)
1176 return -EINVAL; 1176 return -EINVAL;
1177 1177
1178 if (*std == itv->std) 1178 if (std == itv->std)
1179 return 0; 1179 return 0;
1180 1180
1181 if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags) || 1181 if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags) ||