[media] media/radio: use v4l2_ctrl_subscribe_event where possible

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Hans de Goede 2012-04-08 12:59:45 -03:00 committed by Mauro Carvalho Chehab
parent 6c493f8b28
commit a22d85fea8
2 changed files with 2 additions and 22 deletions

View file

@ -150,14 +150,6 @@ static int radio_isa_log_status(struct file *file, void *priv)
return 0; return 0;
} }
static int radio_isa_subscribe_event(struct v4l2_fh *fh,
struct v4l2_event_subscription *sub)
{
if (sub->type == V4L2_EVENT_CTRL)
return v4l2_event_subscribe(fh, sub, 0);
return -EINVAL;
}
static const struct v4l2_ctrl_ops radio_isa_ctrl_ops = { static const struct v4l2_ctrl_ops radio_isa_ctrl_ops = {
.s_ctrl = radio_isa_s_ctrl, .s_ctrl = radio_isa_s_ctrl,
}; };
@ -177,7 +169,7 @@ static const struct v4l2_ioctl_ops radio_isa_ioctl_ops = {
.vidioc_g_frequency = radio_isa_g_frequency, .vidioc_g_frequency = radio_isa_g_frequency,
.vidioc_s_frequency = radio_isa_s_frequency, .vidioc_s_frequency = radio_isa_s_frequency,
.vidioc_log_status = radio_isa_log_status, .vidioc_log_status = radio_isa_log_status,
.vidioc_subscribe_event = radio_isa_subscribe_event, .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
.vidioc_unsubscribe_event = v4l2_event_unsubscribe, .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
}; };

View file

@ -271,18 +271,6 @@ static int keene_s_ctrl(struct v4l2_ctrl *ctrl)
return -EINVAL; return -EINVAL;
} }
static int vidioc_subscribe_event(struct v4l2_fh *fh,
struct v4l2_event_subscription *sub)
{
switch (sub->type) {
case V4L2_EVENT_CTRL:
return v4l2_event_subscribe(fh, sub, 0);
default:
return -EINVAL;
}
}
/* File system interface */ /* File system interface */
static const struct v4l2_file_operations usb_keene_fops = { static const struct v4l2_file_operations usb_keene_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
@ -303,7 +291,7 @@ static const struct v4l2_ioctl_ops usb_keene_ioctl_ops = {
.vidioc_g_frequency = vidioc_g_frequency, .vidioc_g_frequency = vidioc_g_frequency,
.vidioc_s_frequency = vidioc_s_frequency, .vidioc_s_frequency = vidioc_s_frequency,
.vidioc_log_status = v4l2_ctrl_log_status, .vidioc_log_status = v4l2_ctrl_log_status,
.vidioc_subscribe_event = vidioc_subscribe_event, .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
.vidioc_unsubscribe_event = v4l2_event_unsubscribe, .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
}; };