[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>
This commit is contained in:
parent
b5b97f34d1
commit
25bba36866
@ -188,12 +188,10 @@ static ssize_t show_hue(struct device *cd,
|
|||||||
{
|
{
|
||||||
struct video_device *vdev = to_video_device(cd);
|
struct video_device *vdev = to_video_device(cd);
|
||||||
struct usb_usbvision *usbvision = video_get_drvdata(vdev);
|
struct usb_usbvision *usbvision = video_get_drvdata(vdev);
|
||||||
struct v4l2_control ctrl;
|
s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl,
|
||||||
ctrl.id = V4L2_CID_HUE;
|
V4L2_CID_HUE));
|
||||||
ctrl.value = 0;
|
|
||||||
if (usbvision->user)
|
return sprintf(buf, "%d\n", val);
|
||||||
call_all(usbvision, core, g_ctrl, &ctrl);
|
|
||||||
return sprintf(buf, "%d\n", ctrl.value);
|
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR(hue, S_IRUGO, show_hue, NULL);
|
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 video_device *vdev = to_video_device(cd);
|
||||||
struct usb_usbvision *usbvision = video_get_drvdata(vdev);
|
struct usb_usbvision *usbvision = video_get_drvdata(vdev);
|
||||||
struct v4l2_control ctrl;
|
s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl,
|
||||||
ctrl.id = V4L2_CID_CONTRAST;
|
V4L2_CID_CONTRAST));
|
||||||
ctrl.value = 0;
|
|
||||||
if (usbvision->user)
|
return sprintf(buf, "%d\n", val);
|
||||||
call_all(usbvision, core, g_ctrl, &ctrl);
|
|
||||||
return sprintf(buf, "%d\n", ctrl.value);
|
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR(contrast, S_IRUGO, show_contrast, NULL);
|
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 video_device *vdev = to_video_device(cd);
|
||||||
struct usb_usbvision *usbvision = video_get_drvdata(vdev);
|
struct usb_usbvision *usbvision = video_get_drvdata(vdev);
|
||||||
struct v4l2_control ctrl;
|
s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl,
|
||||||
ctrl.id = V4L2_CID_BRIGHTNESS;
|
V4L2_CID_BRIGHTNESS));
|
||||||
ctrl.value = 0;
|
|
||||||
if (usbvision->user)
|
return sprintf(buf, "%d\n", val);
|
||||||
call_all(usbvision, core, g_ctrl, &ctrl);
|
|
||||||
return sprintf(buf, "%d\n", ctrl.value);
|
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR(brightness, S_IRUGO, show_brightness, NULL);
|
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 video_device *vdev = to_video_device(cd);
|
||||||
struct usb_usbvision *usbvision = video_get_drvdata(vdev);
|
struct usb_usbvision *usbvision = video_get_drvdata(vdev);
|
||||||
struct v4l2_control ctrl;
|
s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl,
|
||||||
ctrl.id = V4L2_CID_SATURATION;
|
V4L2_CID_SATURATION));
|
||||||
ctrl.value = 0;
|
|
||||||
if (usbvision->user)
|
return sprintf(buf, "%d\n", val);
|
||||||
call_all(usbvision, core, g_ctrl, &ctrl);
|
|
||||||
return sprintf(buf, "%d\n", ctrl.value);
|
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR(saturation, S_IRUGO, show_saturation, NULL);
|
static DEVICE_ATTR(saturation, S_IRUGO, show_saturation, NULL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user