aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-blackbird.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88/cx88-blackbird.c')
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index 9a1374a38ec7..e71369754305 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -1057,12 +1057,15 @@ static int mpeg_open(struct inode *inode, struct file *file)
1057 struct cx8802_driver *drv = NULL; 1057 struct cx8802_driver *drv = NULL;
1058 int err; 1058 int err;
1059 1059
1060 lock_kernel();
1060 dev = cx8802_get_device(inode); 1061 dev = cx8802_get_device(inode);
1061 1062
1062 dprintk( 1, "%s\n", __func__); 1063 dprintk( 1, "%s\n", __func__);
1063 1064
1064 if (dev == NULL) 1065 if (dev == NULL) {
1066 unlock_kernel();
1065 return -ENODEV; 1067 return -ENODEV;
1068 }
1066 1069
1067 /* Make sure we can acquire the hardware */ 1070 /* Make sure we can acquire the hardware */
1068 drv = cx8802_get_driver(dev, CX88_MPEG_BLACKBIRD); 1071 drv = cx8802_get_driver(dev, CX88_MPEG_BLACKBIRD);
@@ -1070,6 +1073,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
1070 err = drv->request_acquire(drv); 1073 err = drv->request_acquire(drv);
1071 if(err != 0) { 1074 if(err != 0) {
1072 dprintk(1,"%s: Unable to acquire hardware, %d\n", __func__, err); 1075 dprintk(1,"%s: Unable to acquire hardware, %d\n", __func__, err);
1076 unlock_kernel();
1073 return err; 1077 return err;
1074 } 1078 }
1075 } 1079 }
@@ -1077,6 +1081,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
1077 if (blackbird_initialize_codec(dev) < 0) { 1081 if (blackbird_initialize_codec(dev) < 0) {
1078 if (drv) 1082 if (drv)
1079 drv->request_release(drv); 1083 drv->request_release(drv);
1084 unlock_kernel();
1080 return -EINVAL; 1085 return -EINVAL;
1081 } 1086 }
1082 dprintk(1,"open minor=%d\n",minor); 1087 dprintk(1,"open minor=%d\n",minor);
@@ -1086,6 +1091,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
1086 if (NULL == fh) { 1091 if (NULL == fh) {
1087 if (drv) 1092 if (drv)
1088 drv->request_release(drv); 1093 drv->request_release(drv);
1094 unlock_kernel();
1089 return -ENOMEM; 1095 return -ENOMEM;
1090 } 1096 }
1091 file->private_data = fh; 1097 file->private_data = fh;
@@ -1101,6 +1107,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
1101 /* FIXME: locking against other video device */ 1107 /* FIXME: locking against other video device */
1102 cx88_set_scale(dev->core, dev->width, dev->height, 1108 cx88_set_scale(dev->core, dev->width, dev->height,
1103 fh->mpegq.field); 1109 fh->mpegq.field);
1110 unlock_kernel();
1104 1111
1105 return 0; 1112 return 0;
1106} 1113}