aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7164/saa7164-vbi.c
diff options
context:
space:
mode:
authorSteven Toth <stoth@kernellabs.com>2010-10-06 20:52:22 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 05:55:32 -0400
commit214ce3faacafa3cca2fdd340d18ff35cfe463c2b (patch)
treef0cf942a8f78626d1a4ee29a361c360e65b96088 /drivers/media/video/saa7164/saa7164-vbi.c
parent18024ee2df675ad921a8c65e7a9e22180d32da84 (diff)
[media] saa7164: Removed use of the BKL
Remove usage of the BKL and instead used video_set_drvdata() during open fops. Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7164/saa7164-vbi.c')
-rw-r--r--drivers/media/video/saa7164/saa7164-vbi.c48
1 files changed, 9 insertions, 39 deletions
diff --git a/drivers/media/video/saa7164/saa7164-vbi.c b/drivers/media/video/saa7164/saa7164-vbi.c
index a4bcf989a19..323c7cdca37 100644
--- a/drivers/media/video/saa7164/saa7164-vbi.c
+++ b/drivers/media/video/saa7164/saa7164-vbi.c
@@ -1001,57 +1001,26 @@ int saa7164_vbi_fmt(struct file *file, void *priv, struct v4l2_format *f)
1001 1001
1002static int fops_open(struct file *file) 1002static int fops_open(struct file *file)
1003{ 1003{
1004 struct saa7164_dev *h, *dev = NULL; 1004 struct saa7164_dev *dev;
1005 struct saa7164_port *port = NULL; 1005 struct saa7164_port *port;
1006 struct saa7164_port *porte = NULL;
1007 struct saa7164_port *portf = NULL;
1008 struct saa7164_vbi_fh *fh; 1006 struct saa7164_vbi_fh *fh;
1009 struct list_head *list;
1010 int minor = video_devdata(file)->minor;
1011 1007
1012 dprintk(DBGLVL_VBI, "%s()\n", __func__); 1008 port = (struct saa7164_port *)video_get_drvdata(video_devdata(file));
1013 1009 if (!port)
1014 /* TODO: Really, the BKL? - remove this */ 1010 return -ENODEV;
1015 lock_kernel();
1016 list_for_each(list, &saa7164_devlist) {
1017 h = list_entry(list, struct saa7164_dev, devlist);
1018
1019 porte = &h->ports[SAA7164_PORT_VBI1];
1020 portf = &h->ports[SAA7164_PORT_VBI2];
1021
1022 if (porte->v4l_device &&
1023 porte->v4l_device->minor == minor) {
1024 dev = h;
1025 port = porte;
1026 break;
1027 }
1028
1029 if (portf->v4l_device &&
1030 portf->v4l_device->minor == minor) {
1031 dev = h;
1032 port = portf;
1033 break;
1034 }
1035 1011
1036 } 1012 dev = port->dev;
1037 1013
1038 if (port == NULL) { 1014 dprintk(DBGLVL_VBI, "%s()\n", __func__);
1039 unlock_kernel();
1040 return -ENODEV;
1041 }
1042 1015
1043 /* allocate + initialize per filehandle data */ 1016 /* allocate + initialize per filehandle data */
1044 fh = kzalloc(sizeof(*fh), GFP_KERNEL); 1017 fh = kzalloc(sizeof(*fh), GFP_KERNEL);
1045 if (NULL == fh) { 1018 if (NULL == fh)
1046 unlock_kernel();
1047 return -ENOMEM; 1019 return -ENOMEM;
1048 }
1049 1020
1050 file->private_data = fh; 1021 file->private_data = fh;
1051 fh->port = port; 1022 fh->port = port;
1052 1023
1053 unlock_kernel();
1054
1055 return 0; 1024 return 0;
1056} 1025}
1057 1026
@@ -1363,6 +1332,7 @@ int saa7164_vbi_register(struct saa7164_port *port)
1363 goto failed; 1332 goto failed;
1364 } 1333 }
1365 1334
1335 video_set_drvdata(port->v4l_device, port);
1366 result = video_register_device(port->v4l_device, 1336 result = video_register_device(port->v4l_device,
1367 VFL_TYPE_VBI, -1); 1337 VFL_TYPE_VBI, -1);
1368 if (result < 0) { 1338 if (result < 0) {