Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250233
b: refs/heads/master
c: 579b2b4
h: refs/heads/master
i:
  250231: 023ca38
v: v3
  • Loading branch information
Jonathan Nieder authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent a70e7f1 commit a307009
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 344d6c6ba6ba5c4fede2f07adbd26d53109a2dd8
refs/heads/master: 579b2b45120fa33f750cd65150d6d8995938750b
25 changes: 14 additions & 11 deletions trunk/drivers/media/video/cx88/cx88-blackbird.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,18 +1060,21 @@ static int mpeg_open(struct file *file)

/* Make sure we can acquire the hardware */
drv = cx8802_get_driver(dev, CX88_MPEG_BLACKBIRD);
if (drv) {
err = drv->request_acquire(drv);
if(err != 0) {
dprintk(1,"%s: Unable to acquire hardware, %d\n", __func__, err);
mutex_unlock(&dev->core->lock);
return err;
}
if (!drv) {
dprintk(1, "%s: blackbird driver is not loaded\n", __func__);
mutex_unlock(&dev->core->lock);
return -ENODEV;
}

err = drv->request_acquire(drv);
if (err != 0) {
dprintk(1,"%s: Unable to acquire hardware, %d\n", __func__, err);
mutex_unlock(&dev->core->lock);
return err;
}

if (!atomic_read(&dev->core->mpeg_users) && blackbird_initialize_codec(dev) < 0) {
if (drv)
drv->request_release(drv);
drv->request_release(drv);
mutex_unlock(&dev->core->lock);
return -EINVAL;
}
Expand All @@ -1080,8 +1083,7 @@ static int mpeg_open(struct file *file)
/* allocate + initialize per filehandle data */
fh = kzalloc(sizeof(*fh),GFP_KERNEL);
if (NULL == fh) {
if (drv)
drv->request_release(drv);
drv->request_release(drv);
mutex_unlock(&dev->core->lock);
return -ENOMEM;
}
Expand Down Expand Up @@ -1125,6 +1127,7 @@ static int mpeg_release(struct file *file)

/* Make sure we release the hardware */
drv = cx8802_get_driver(dev, CX88_MPEG_BLACKBIRD);
WARN_ON(!drv);
if (drv)
drv->request_release(drv);

Expand Down

0 comments on commit a307009

Please sign in to comment.