Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106754
b: refs/heads/master
c: 1052efe
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jul 27, 2008
1 parent 4c5003f commit 25f759d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 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: feb75f07102a85026d41e2c4e4113c34dd035c30
refs/heads/master: 1052efe0fc69130d9d6a44bc9ceecd229221d9a1
12 changes: 4 additions & 8 deletions trunk/drivers/media/video/saa7134/saa7134-empress.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ static int ts_open(struct inode *inode, struct file *file)
err = -EBUSY;
if (!mutex_trylock(&dev->empress_tsq.vb_lock))
goto done;
if (dev->empress_users)
if (atomic_read(&dev->empress_users))
goto done_up;

/* Unmute audio */
saa_writeb(SAA7134_AUDIO_MUTE_CTRL,
saa_readb(SAA7134_AUDIO_MUTE_CTRL) & ~(1 << 6));

dev->empress_users++;
atomic_inc(&dev->empress_users);
file->private_data = dev;
err = 0;

Expand All @@ -110,8 +110,6 @@ static int ts_release(struct inode *inode, struct file *file)
{
struct saa7134_dev *dev = file->private_data;

mutex_lock(&dev->empress_tsq.vb_lock);

videobuf_stop(&dev->empress_tsq);
videobuf_mmap_free(&dev->empress_tsq);

Expand All @@ -122,9 +120,7 @@ static int ts_release(struct inode *inode, struct file *file)
saa_writeb(SAA7134_AUDIO_MUTE_CTRL,
saa_readb(SAA7134_AUDIO_MUTE_CTRL) | (1 << 6));

dev->empress_users--;

mutex_unlock(&dev->empress_tsq.vb_lock);
atomic_dec(&dev->empress_users);

return 0;
}
Expand Down Expand Up @@ -447,7 +443,7 @@ static void empress_signal_update(struct work_struct *work)
ts_reset_encoder(dev);
} else {
dprintk("video signal acquired\n");
if (dev->empress_users)
if (atomic_read(&dev->empress_users))
ts_init_encoder(dev);
}
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/saa7134/saa7134.h
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ struct saa7134_dev {
/* SAA7134_MPEG_EMPRESS only */
struct video_device *empress_dev;
struct videobuf_queue empress_tsq;
unsigned int empress_users;
atomic_t empress_users;
struct work_struct empress_workqueue;
int empress_started;

Expand Down

0 comments on commit 25f759d

Please sign in to comment.