Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250234
b: refs/heads/master
c: f4bd4be
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Nieder authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent a307009 commit 721801a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 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: 579b2b45120fa33f750cd65150d6d8995938750b
refs/heads/master: f4bd4be8d113534a28e0c9a86cddbabd47b06159
11 changes: 6 additions & 5 deletions trunk/drivers/media/video/cx88/cx88-blackbird.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ static int mpeg_open(struct file *file)
return err;
}

if (!atomic_read(&dev->core->mpeg_users) && blackbird_initialize_codec(dev) < 0) {
if (!dev->core->mpeg_users && blackbird_initialize_codec(dev) < 0) {
drv->request_release(drv);
mutex_unlock(&dev->core->lock);
return -EINVAL;
Expand Down Expand Up @@ -1101,7 +1101,7 @@ static int mpeg_open(struct file *file)
cx88_set_scale(dev->core, dev->width, dev->height,
fh->mpegq.field);

atomic_inc(&dev->core->mpeg_users);
dev->core->mpeg_users++;
mutex_unlock(&dev->core->lock);
return 0;
}
Expand All @@ -1112,7 +1112,9 @@ static int mpeg_release(struct file *file)
struct cx8802_dev *dev = fh->dev;
struct cx8802_driver *drv = NULL;

if (dev->mpeg_active && atomic_read(&dev->core->mpeg_users) == 1)
mutex_lock(&dev->core->lock);

if (dev->mpeg_active && dev->core->mpeg_users == 1)
blackbird_stop_codec(dev);

cx8802_cancel_buffers(fh->dev);
Expand All @@ -1121,7 +1123,6 @@ static int mpeg_release(struct file *file)

videobuf_mmap_free(&fh->mpegq);

mutex_lock(&dev->core->lock);
file->private_data = NULL;
kfree(fh);

Expand All @@ -1131,7 +1132,7 @@ static int mpeg_release(struct file *file)
if (drv)
drv->request_release(drv);

atomic_dec(&dev->core->mpeg_users);
dev->core->mpeg_users--;

mutex_unlock(&dev->core->lock);

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/cx88/cx88.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ struct cx88_core {
/* various v4l controls */
u32 freq;
atomic_t users;
atomic_t mpeg_users;
int mpeg_users;

/* cx88-video needs to access cx8802 for hybrid tuner pll access. */
struct cx8802_dev *dvbdev;
Expand Down

0 comments on commit 721801a

Please sign in to comment.