summaryrefslogtreecommitdiff
path: root/drivers/media/video/saa7134/saa7134-empress.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2009-12-10 16:44:04 +0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-16 05:17:56 +0300
commit63b0d5ad20365edf8baf96cdbb8e7faf62501286 (patch)
tree9a12041cab48051834ee67d0de358443464e5d94 /drivers/media/video/saa7134/saa7134-empress.c
parentf0813b4c9f7ffbeaddcba1c08a1812f7ff30e1b7 (diff)
downloadlinux-63b0d5ad20365edf8baf96cdbb8e7faf62501286.tar.xz
V4L/DVB (13554a): v4l: Use the video_drvdata function in drivers
Fix all device drivers to use the video_drvdata function instead of maintaining a local list of minor to private data mappings. Call video_set_drvdata to register the driver private pointer when not already done. Where applicable, the local list of mappings is completely removed when it becomes unused. [mchehab.redhat.com: removed tm6000 changes as tm6000 is not ready yet for submission even on staging] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-empress.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index abc1d0bf5837..1de27af54590 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -87,17 +87,9 @@ static int ts_init_encoder(struct saa7134_dev* dev)
static int ts_open(struct file *file)
{
int minor = video_devdata(file)->minor;
- struct saa7134_dev *dev;
+ struct saa7134_dev *dev = video_drvdata(file);
int err;
- lock_kernel();
- list_for_each_entry(dev, &saa7134_devlist, devlist)
- if (dev->empress_dev && dev->empress_dev->minor == minor)
- goto found;
- unlock_kernel();
- return -ENODEV;
- found:
-
dprintk("open minor=%d\n",minor);
err = -EBUSY;
if (!mutex_trylock(&dev->empress_tsq.vb_lock))
@@ -531,6 +523,7 @@ static int empress_init(struct saa7134_dev *dev)
INIT_WORK(&dev->empress_workqueue, empress_signal_update);
+ video_set_drvdata(dev->empress_dev, dev);
err = video_register_device(dev->empress_dev,VFL_TYPE_GRABBER,
empress_nr[dev->nr]);
if (err < 0) {