[media] usbvision: use v4l2_ctrl_g_ctrl instead of the g_ctrl op
authorHans Verkuil <hans.verkuil@cisco.com>
Sun, 3 Jul 2016 11:58:07 +0000 (08:58 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 12 Jul 2016 14:12:59 +0000 (11:12 -0300)
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>
drivers/media/usb/usbvision/usbvision-video.c

index ad2f3d2..c8b4eb2 100644 (file)
@@ -188,12 +188,10 @@ static ssize_t show_hue(struct device *cd,
 {
        struct video_device *vdev = to_video_device(cd);
        struct usb_usbvision *usbvision = video_get_drvdata(vdev);
-       struct v4l2_control ctrl;
-       ctrl.id = V4L2_CID_HUE;
-       ctrl.value = 0;
-       if (usbvision->user)
-               call_all(usbvision, core, g_ctrl, &ctrl);
-       return sprintf(buf, "%d\n", ctrl.value);
+       s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl,
+                                                 V4L2_CID_HUE));
+
+       return sprintf(buf, "%d\n", val);
 }
 static DEVICE_ATTR(hue, S_IRUGO, show_hue, NULL);
 
@@ -202,12 +200,10 @@ static ssize_t show_contrast(struct device *cd,
 {
        struct video_device *vdev = to_video_device(cd);
        struct usb_usbvision *usbvision = video_get_drvdata(vdev);
-       struct v4l2_control ctrl;
-       ctrl.id = V4L2_CID_CONTRAST;
-       ctrl.value = 0;
-       if (usbvision->user)
-               call_all(usbvision, core, g_ctrl, &ctrl);
-       return sprintf(buf, "%d\n", ctrl.value);
+       s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl,
+                                                 V4L2_CID_CONTRAST));
+
+       return sprintf(buf, "%d\n", val);
 }
 static DEVICE_ATTR(contrast, S_IRUGO, show_contrast, NULL);
 
@@ -216,12 +212,10 @@ static ssize_t show_brightness(struct device *cd,
 {
        struct video_device *vdev = to_video_device(cd);
        struct usb_usbvision *usbvision = video_get_drvdata(vdev);
-       struct v4l2_control ctrl;
-       ctrl.id = V4L2_CID_BRIGHTNESS;
-       ctrl.value = 0;
-       if (usbvision->user)
-               call_all(usbvision, core, g_ctrl, &ctrl);
-       return sprintf(buf, "%d\n", ctrl.value);
+       s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl,
+                                                 V4L2_CID_BRIGHTNESS));
+
+       return sprintf(buf, "%d\n", val);
 }
 static DEVICE_ATTR(brightness, S_IRUGO, show_brightness, NULL);
 
@@ -230,12 +224,10 @@ static ssize_t show_saturation(struct device *cd,
 {
        struct video_device *vdev = to_video_device(cd);
        struct usb_usbvision *usbvision = video_get_drvdata(vdev);
-       struct v4l2_control ctrl;
-       ctrl.id = V4L2_CID_SATURATION;
-       ctrl.value = 0;
-       if (usbvision->user)
-               call_all(usbvision, core, g_ctrl, &ctrl);
-       return sprintf(buf, "%d\n", ctrl.value);
+       s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl,
+                                                 V4L2_CID_SATURATION));
+
+       return sprintf(buf, "%d\n", val);
 }
 static DEVICE_ATTR(saturation, S_IRUGO, show_saturation, NULL);