summaryrefslogtreecommitdiff
path: root/drivers/media/video/au0828/au0828-video.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 18:09:16 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 18:09:16 (GMT)
commit6a5df38f5f07981dda5457ec6c05efe1c4200d84 (patch)
treed82c3862f7ba719d7723111140a0c89e6387cb19 /drivers/media/video/au0828/au0828-video.c
parent9cfc86249f32d984339c6d1f8a1fd1326989b3b8 (diff)
parent262ab9ac0daadebcece8e3cbf3ae66ee8774cfd7 (diff)
downloadlinux-6a5df38f5f07981dda5457ec6c05efe1c4200d84.tar.xz
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (116 commits) V4L/DVB (13698): pms: replace asm/uaccess.h to linux/uaccess.h V4L/DVB (13690): radio/si470x: #include <sched.h> V4L/DVB (13688): au8522: modify the attributes of local filter coefficients V4L/DVB (13687): cx231xx: use NULL when pointer is needed V4L/DVB: Davinci VPFE Capture: remove unused #include <linux/version.h> V4L/DVB (13685): Correct code taking the size of a pointer V4L/DVB (13684): Fix some cut-and-paste noise in dib0090.h V4L/DVB (13683): sanio-ms: clean up init, exit and id_table V4L/DVB (13682): dib8000: make some constant static V4L/DVB: lgs8gxx: Use shifts rather than multiply/divide when possible V4L/DVB (13680b): DocBook/media: create links for included sources V4L/DVB (13680a): DocBook/media: copy images after building HTML V4L/DVB (13678): Add support for yet another DvbWorld, TeVii and Prof USB devices V4L/DVB (13676): configurable IRQ mode on NetUP Dual DVB-S2 CI; IRQ from CAM processing (CI interface works faster) V4L/DVB (13674): stv090x: Add DiSEqC envelope mode V4L/DVB (13673): lnbp21: Implement 22 kHz tone control V4L/DVB (13671): sh_mobile_ceu_camera: Remove frame size page alignment V4L/DVB (13670): soc-camera: Add mt9t112 camera driver V4L/DVB (13669): tw9910: Add sync polarity support V4L/DVB (13668): tw9910: remove cropping ...
Diffstat (limited to 'drivers/media/video/au0828/au0828-video.c')
-rw-r--r--drivers/media/video/au0828/au0828-video.c36
1 files changed, 8 insertions, 28 deletions
diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c
index 1485aee..dc67bc4 100644
--- a/drivers/media/video/au0828/au0828-video.c
+++ b/drivers/media/video/au0828/au0828-video.c
@@ -40,7 +40,6 @@
#include "au0828.h"
#include "au0828-reg.h"
-static LIST_HEAD(au0828_devlist);
static DEFINE_MUTEX(au0828_sysfs_lock);
#define AU0828_VERSION_CODE KERNEL_VERSION(0, 0, 1)
@@ -693,10 +692,8 @@ void au0828_analog_unregister(struct au0828_dev *dev)
dprintk(1, "au0828_release_resources called\n");
mutex_lock(&au0828_sysfs_lock);
- if (dev->vdev) {
- list_del(&dev->au0828list);
+ if (dev->vdev)
video_unregister_device(dev->vdev);
- }
if (dev->vbi_dev)
video_unregister_device(dev->vbi_dev);
@@ -737,29 +734,15 @@ static void res_free(struct au0828_fh *fh)
static int au0828_v4l2_open(struct file *filp)
{
- int minor = video_devdata(filp)->minor;
int ret = 0;
- struct au0828_dev *h, *dev = NULL;
+ struct au0828_dev *dev = video_drvdata(filp);
struct au0828_fh *fh;
- int type = 0;
- struct list_head *list;
-
- list_for_each(list, &au0828_devlist) {
- h = list_entry(list, struct au0828_dev, au0828list);
- if (h->vdev->minor == minor) {
- dev = h;
- type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- }
+ int type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
#ifdef VBI_IS_WORKING
- if (h->vbi_dev->minor == minor) {
- dev = h;
- type = V4L2_BUF_TYPE_VBI_CAPTURE;
- }
+ if (video_devdata(filp)->vfl_type == VFL_TYPE_GRABBER)
+ type = V4L2_BUF_TYPE_VBI_CAPTURE;
#endif
- }
-
- if (NULL == dev)
- return -ENODEV;
fh = kzalloc(sizeof(struct au0828_fh), GFP_KERNEL);
if (NULL == fh) {
@@ -1587,7 +1570,6 @@ static const struct video_device au0828_video_template = {
.fops = &au0828_v4l_fops,
.release = video_device_release,
.ioctl_ops = &video_ioctl_ops,
- .minor = -1,
.tvnorms = V4L2_STD_NTSC_M,
.current_norm = V4L2_STD_NTSC_M,
};
@@ -1676,25 +1658,23 @@ int au0828_analog_register(struct au0828_dev *dev,
strcpy(dev->vbi_dev->name, "au0828a vbi");
#endif
- list_add_tail(&dev->au0828list, &au0828_devlist);
-
/* Register the v4l2 device */
+ video_set_drvdata(dev->vdev, dev);
retval = video_register_device(dev->vdev, VFL_TYPE_GRABBER, -1);
if (retval != 0) {
dprintk(1, "unable to register video device (error = %d).\n",
retval);
- list_del(&dev->au0828list);
video_device_release(dev->vdev);
return -ENODEV;
}
#ifdef VBI_IS_WORKING
/* Register the vbi device */
+ video_set_drvdata(dev->vbi_dev, dev);
retval = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, -1);
if (retval != 0) {
dprintk(1, "unable to register vbi device (error = %d).\n",
retval);
- list_del(&dev->au0828list);
video_device_release(dev->vbi_dev);
video_device_release(dev->vdev);
return -ENODEV;