diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-09-07 04:52:40 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-04 21:51:28 -0500 |
commit | 69a61642ac60e84647394b4cf0f322579701d218 (patch) | |
tree | 2212c4d99d9ccd1f103c0d57dfa7e881ac274c83 /drivers/media/usb/em28xx | |
parent | 081b945ed74c9bd37da2ee928f9ad281222a6477 (diff) |
[media] em28xx: convert to v4l2_fh, fix priority handling
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/em28xx')
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-video.c | 5 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index ebbf775fcaba..c67ff8d96d22 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c | |||
@@ -1735,6 +1735,7 @@ static int em28xx_v4l2_open(struct file *filp) | |||
1735 | mutex_unlock(&dev->lock); | 1735 | mutex_unlock(&dev->lock); |
1736 | return -ENOMEM; | 1736 | return -ENOMEM; |
1737 | } | 1737 | } |
1738 | v4l2_fh_init(&fh->fh, vdev); | ||
1738 | fh->dev = dev; | 1739 | fh->dev = dev; |
1739 | fh->radio = radio; | 1740 | fh->radio = radio; |
1740 | fh->type = fh_type; | 1741 | fh->type = fh_type; |
@@ -1774,6 +1775,7 @@ static int em28xx_v4l2_open(struct file *filp) | |||
1774 | V4L2_FIELD_SEQ_TB, | 1775 | V4L2_FIELD_SEQ_TB, |
1775 | sizeof(struct em28xx_buffer), fh, &dev->lock); | 1776 | sizeof(struct em28xx_buffer), fh, &dev->lock); |
1776 | mutex_unlock(&dev->lock); | 1777 | mutex_unlock(&dev->lock); |
1778 | v4l2_fh_add(&fh->fh); | ||
1777 | 1779 | ||
1778 | return errCode; | 1780 | return errCode; |
1779 | } | 1781 | } |
@@ -1867,6 +1869,8 @@ static int em28xx_v4l2_close(struct file *filp) | |||
1867 | "0 (error=%i)\n", errCode); | 1869 | "0 (error=%i)\n", errCode); |
1868 | } | 1870 | } |
1869 | } | 1871 | } |
1872 | v4l2_fh_del(&fh->fh); | ||
1873 | v4l2_fh_exit(&fh->fh); | ||
1870 | 1874 | ||
1871 | videobuf_mmap_free(&fh->vb_vidq); | 1875 | videobuf_mmap_free(&fh->vb_vidq); |
1872 | videobuf_mmap_free(&fh->vb_vbiq); | 1876 | videobuf_mmap_free(&fh->vb_vbiq); |
@@ -2088,6 +2092,7 @@ static struct video_device *em28xx_vdev_init(struct em28xx *dev, | |||
2088 | vfd->release = video_device_release; | 2092 | vfd->release = video_device_release; |
2089 | vfd->debug = video_debug; | 2093 | vfd->debug = video_debug; |
2090 | vfd->lock = &dev->lock; | 2094 | vfd->lock = &dev->lock; |
2095 | set_bit(V4L2_FL_USE_FH_PRIO, &vfd->flags); | ||
2091 | 2096 | ||
2092 | snprintf(vfd->name, sizeof(vfd->name), "%s %s", | 2097 | snprintf(vfd->name, sizeof(vfd->name), "%s %s", |
2093 | dev->name, type_name); | 2098 | dev->name, type_name); |
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index 707319eabe2d..7432be483c22 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <media/videobuf-vmalloc.h> | 34 | #include <media/videobuf-vmalloc.h> |
35 | #include <media/v4l2-device.h> | 35 | #include <media/v4l2-device.h> |
36 | #include <media/v4l2-ctrls.h> | 36 | #include <media/v4l2-ctrls.h> |
37 | #include <media/v4l2-fh.h> | ||
37 | #include <media/ir-kbd-i2c.h> | 38 | #include <media/ir-kbd-i2c.h> |
38 | #include <media/rc-core.h> | 39 | #include <media/rc-core.h> |
39 | #if defined(CONFIG_VIDEO_EM28XX_DVB) || defined(CONFIG_VIDEO_EM28XX_DVB_MODULE) | 40 | #if defined(CONFIG_VIDEO_EM28XX_DVB) || defined(CONFIG_VIDEO_EM28XX_DVB_MODULE) |
@@ -477,6 +478,7 @@ struct em28xx_audio { | |||
477 | struct em28xx; | 478 | struct em28xx; |
478 | 479 | ||
479 | struct em28xx_fh { | 480 | struct em28xx_fh { |
481 | struct v4l2_fh fh; | ||
480 | struct em28xx *dev; | 482 | struct em28xx *dev; |
481 | int radio; | 483 | int radio; |
482 | unsigned int resources; | 484 | unsigned int resources; |