aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-blackbird.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2009-12-10 08:44:04 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-15 21:17:56 -0500
commit63b0d5ad20365edf8baf96cdbb8e7faf62501286 (patch)
tree9a12041cab48051834ee67d0de358443464e5d94 /drivers/media/video/cx88/cx88-blackbird.c
parentf0813b4c9f7ffbeaddcba1c08a1812f7ff30e1b7 (diff)
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/cx88/cx88-blackbird.c')
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index 5186f87b4ece..f0ef94150d1e 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -1049,20 +1049,14 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id)
1049static int mpeg_open(struct file *file) 1049static int mpeg_open(struct file *file)
1050{ 1050{
1051 int minor = video_devdata(file)->minor; 1051 int minor = video_devdata(file)->minor;
1052 struct cx8802_dev *dev = NULL; 1052 struct cx8802_dev *dev = video_drvdata(file);
1053 struct cx8802_fh *fh; 1053 struct cx8802_fh *fh;
1054 struct cx8802_driver *drv = NULL; 1054 struct cx8802_driver *drv = NULL;
1055 int err; 1055 int err;
1056 1056
1057 lock_kernel();
1058 dev = cx8802_get_device(minor);
1059
1060 dprintk( 1, "%s\n", __func__); 1057 dprintk( 1, "%s\n", __func__);
1061 1058
1062 if (dev == NULL) { 1059 lock_kernel();
1063 unlock_kernel();
1064 return -ENODEV;
1065 }
1066 1060
1067 /* Make sure we can acquire the hardware */ 1061 /* Make sure we can acquire the hardware */
1068 drv = cx8802_get_driver(dev, CX88_MPEG_BLACKBIRD); 1062 drv = cx8802_get_driver(dev, CX88_MPEG_BLACKBIRD);
@@ -1129,10 +1123,6 @@ static int mpeg_release(struct file *file)
1129 kfree(fh); 1123 kfree(fh);
1130 1124
1131 /* Make sure we release the hardware */ 1125 /* Make sure we release the hardware */
1132 dev = cx8802_get_device(video_devdata(file)->minor);
1133 if (dev == NULL)
1134 return -ENODEV;
1135
1136 drv = cx8802_get_driver(dev, CX88_MPEG_BLACKBIRD); 1126 drv = cx8802_get_driver(dev, CX88_MPEG_BLACKBIRD);
1137 if (drv) 1127 if (drv)
1138 drv->request_release(drv); 1128 drv->request_release(drv);
@@ -1290,6 +1280,7 @@ static int blackbird_register_video(struct cx8802_dev *dev)
1290 1280
1291 dev->mpeg_dev = cx88_vdev_init(dev->core,dev->pci, 1281 dev->mpeg_dev = cx88_vdev_init(dev->core,dev->pci,
1292 &cx8802_mpeg_template,"mpeg"); 1282 &cx8802_mpeg_template,"mpeg");
1283 video_set_drvdata(dev->mpeg_dev, dev);
1293 err = video_register_device(dev->mpeg_dev,VFL_TYPE_GRABBER, -1); 1284 err = video_register_device(dev->mpeg_dev,VFL_TYPE_GRABBER, -1);
1294 if (err < 0) { 1285 if (err < 0) {
1295 printk(KERN_INFO "%s/2: can't register mpeg device\n", 1286 printk(KERN_INFO "%s/2: can't register mpeg device\n",