diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-04-08 11:59:45 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-07 15:26:32 -0400 |
commit | a22d85fea89744fad2cb215da1fe0c1ce226a613 (patch) | |
tree | 2506940fd4b9d294d3c07c03144e766a14d0107b | |
parent | 6c493f8b28c6744995e92801a20dca192635dd22 (diff) |
[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>
-rw-r--r-- | drivers/media/radio/radio-isa.c | 10 | ||||
-rw-r--r-- | drivers/media/radio/radio-keene.c | 14 |
2 files changed, 2 insertions, 22 deletions
diff --git a/drivers/media/radio/radio-isa.c b/drivers/media/radio/radio-isa.c index c7450fb90d2..3c0067de432 100644 --- a/drivers/media/radio/radio-isa.c +++ b/drivers/media/radio/radio-isa.c | |||
@@ -150,14 +150,6 @@ static int radio_isa_log_status(struct file *file, void *priv) | |||
150 | return 0; | 150 | return 0; |
151 | } | 151 | } |
152 | 152 | ||
153 | static int radio_isa_subscribe_event(struct v4l2_fh *fh, | ||
154 | struct v4l2_event_subscription *sub) | ||
155 | { | ||
156 | if (sub->type == V4L2_EVENT_CTRL) | ||
157 | return v4l2_event_subscribe(fh, sub, 0); | ||
158 | return -EINVAL; | ||
159 | } | ||
160 | |||
161 | static const struct v4l2_ctrl_ops radio_isa_ctrl_ops = { | 153 | static const struct v4l2_ctrl_ops radio_isa_ctrl_ops = { |
162 | .s_ctrl = radio_isa_s_ctrl, | 154 | .s_ctrl = radio_isa_s_ctrl, |
163 | }; | 155 | }; |
@@ -177,7 +169,7 @@ static const struct v4l2_ioctl_ops radio_isa_ioctl_ops = { | |||
177 | .vidioc_g_frequency = radio_isa_g_frequency, | 169 | .vidioc_g_frequency = radio_isa_g_frequency, |
178 | .vidioc_s_frequency = radio_isa_s_frequency, | 170 | .vidioc_s_frequency = radio_isa_s_frequency, |
179 | .vidioc_log_status = radio_isa_log_status, | 171 | .vidioc_log_status = radio_isa_log_status, |
180 | .vidioc_subscribe_event = radio_isa_subscribe_event, | 172 | .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, |
181 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, | 173 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, |
182 | }; | 174 | }; |
183 | 175 | ||
diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c index 62d32c4946f..79adf3e654e 100644 --- a/drivers/media/radio/radio-keene.c +++ b/drivers/media/radio/radio-keene.c | |||
@@ -271,18 +271,6 @@ static int keene_s_ctrl(struct v4l2_ctrl *ctrl) | |||
271 | return -EINVAL; | 271 | return -EINVAL; |
272 | } | 272 | } |
273 | 273 | ||
274 | static int vidioc_subscribe_event(struct v4l2_fh *fh, | ||
275 | struct v4l2_event_subscription *sub) | ||
276 | { | ||
277 | switch (sub->type) { | ||
278 | case V4L2_EVENT_CTRL: | ||
279 | return v4l2_event_subscribe(fh, sub, 0); | ||
280 | default: | ||
281 | return -EINVAL; | ||
282 | } | ||
283 | } | ||
284 | |||
285 | |||
286 | /* File system interface */ | 274 | /* File system interface */ |
287 | static const struct v4l2_file_operations usb_keene_fops = { | 275 | static const struct v4l2_file_operations usb_keene_fops = { |
288 | .owner = THIS_MODULE, | 276 | .owner = THIS_MODULE, |
@@ -303,7 +291,7 @@ static const struct v4l2_ioctl_ops usb_keene_ioctl_ops = { | |||
303 | .vidioc_g_frequency = vidioc_g_frequency, | 291 | .vidioc_g_frequency = vidioc_g_frequency, |
304 | .vidioc_s_frequency = vidioc_s_frequency, | 292 | .vidioc_s_frequency = vidioc_s_frequency, |
305 | .vidioc_log_status = v4l2_ctrl_log_status, | 293 | .vidioc_log_status = v4l2_ctrl_log_status, |
306 | .vidioc_subscribe_event = vidioc_subscribe_event, | 294 | .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, |
307 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, | 295 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, |
308 | }; | 296 | }; |
309 | 297 | ||