diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2016-07-03 07:58:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-07-12 10:12:59 -0400 |
commit | 25bba3686697b7dd84545d666a95b451888d93ba (patch) | |
tree | 00efe56a19febde52984103209241670cac15858 | |
parent | b5b97f34d1862ecde0193b7cbdfc59a3714433cf (diff) |
[media] usbvision: use v4l2_ctrl_g_ctrl instead of the g_ctrl op
This op is deprecated and should not be used anymore.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/usb/usbvision/usbvision-video.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c index ad2f3d27b266..c8b4eb2ee7a2 100644 --- a/drivers/media/usb/usbvision/usbvision-video.c +++ b/drivers/media/usb/usbvision/usbvision-video.c | |||
@@ -188,12 +188,10 @@ static ssize_t show_hue(struct device *cd, | |||
188 | { | 188 | { |
189 | struct video_device *vdev = to_video_device(cd); | 189 | struct video_device *vdev = to_video_device(cd); |
190 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); | 190 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); |
191 | struct v4l2_control ctrl; | 191 | s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl, |
192 | ctrl.id = V4L2_CID_HUE; | 192 | V4L2_CID_HUE)); |
193 | ctrl.value = 0; | 193 | |
194 | if (usbvision->user) | 194 | return sprintf(buf, "%d\n", val); |
195 | call_all(usbvision, core, g_ctrl, &ctrl); | ||
196 | return sprintf(buf, "%d\n", ctrl.value); | ||
197 | } | 195 | } |
198 | static DEVICE_ATTR(hue, S_IRUGO, show_hue, NULL); | 196 | static DEVICE_ATTR(hue, S_IRUGO, show_hue, NULL); |
199 | 197 | ||
@@ -202,12 +200,10 @@ static ssize_t show_contrast(struct device *cd, | |||
202 | { | 200 | { |
203 | struct video_device *vdev = to_video_device(cd); | 201 | struct video_device *vdev = to_video_device(cd); |
204 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); | 202 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); |
205 | struct v4l2_control ctrl; | 203 | s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl, |
206 | ctrl.id = V4L2_CID_CONTRAST; | 204 | V4L2_CID_CONTRAST)); |
207 | ctrl.value = 0; | 205 | |
208 | if (usbvision->user) | 206 | return sprintf(buf, "%d\n", val); |
209 | call_all(usbvision, core, g_ctrl, &ctrl); | ||
210 | return sprintf(buf, "%d\n", ctrl.value); | ||
211 | } | 207 | } |
212 | static DEVICE_ATTR(contrast, S_IRUGO, show_contrast, NULL); | 208 | static DEVICE_ATTR(contrast, S_IRUGO, show_contrast, NULL); |
213 | 209 | ||
@@ -216,12 +212,10 @@ static ssize_t show_brightness(struct device *cd, | |||
216 | { | 212 | { |
217 | struct video_device *vdev = to_video_device(cd); | 213 | struct video_device *vdev = to_video_device(cd); |
218 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); | 214 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); |
219 | struct v4l2_control ctrl; | 215 | s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl, |
220 | ctrl.id = V4L2_CID_BRIGHTNESS; | 216 | V4L2_CID_BRIGHTNESS)); |
221 | ctrl.value = 0; | 217 | |
222 | if (usbvision->user) | 218 | return sprintf(buf, "%d\n", val); |
223 | call_all(usbvision, core, g_ctrl, &ctrl); | ||
224 | return sprintf(buf, "%d\n", ctrl.value); | ||
225 | } | 219 | } |
226 | static DEVICE_ATTR(brightness, S_IRUGO, show_brightness, NULL); | 220 | static DEVICE_ATTR(brightness, S_IRUGO, show_brightness, NULL); |
227 | 221 | ||
@@ -230,12 +224,10 @@ static ssize_t show_saturation(struct device *cd, | |||
230 | { | 224 | { |
231 | struct video_device *vdev = to_video_device(cd); | 225 | struct video_device *vdev = to_video_device(cd); |
232 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); | 226 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); |
233 | struct v4l2_control ctrl; | 227 | s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl, |
234 | ctrl.id = V4L2_CID_SATURATION; | 228 | V4L2_CID_SATURATION)); |
235 | ctrl.value = 0; | 229 | |
236 | if (usbvision->user) | 230 | return sprintf(buf, "%d\n", val); |
237 | call_all(usbvision, core, g_ctrl, &ctrl); | ||
238 | return sprintf(buf, "%d\n", ctrl.value); | ||
239 | } | 231 | } |
240 | static DEVICE_ATTR(saturation, S_IRUGO, show_saturation, NULL); | 232 | static DEVICE_ATTR(saturation, S_IRUGO, show_saturation, NULL); |
241 | 233 | ||