Message ID | 20110405033114.GH4498@elie (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Jonathan Nieder wrote:
> [Subject: [PATCH 7/7] [mpeg] cx88: don't use atomic_t for core->users]
The subject should say [media] rather than [mpeg]. I fixed it locally
and then sent the wrong patch; sorry for the nonsense.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 287a41e..d719d12 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -824,7 +824,7 @@ static int video_open(struct file *file) call_all(core, tuner, s_radio); } - atomic_inc(&core->users); + core->users++; mutex_unlock(&core->lock); return 0; @@ -922,7 +922,8 @@ static int video_release(struct file *file) file->private_data = NULL; kfree(fh); - if(atomic_dec_and_test(&dev->core->users)) + dev->core->users--; + if (!dev->core->users) call_all(dev->core, core, s_power, 0); mutex_unlock(&dev->core->lock); diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 9e8176e..a399a8b 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -389,7 +389,7 @@ struct cx88_core { struct mutex lock; /* various v4l controls */ u32 freq; - atomic_t users; + int users; int mpeg_users; /* cx88-video needs to access cx8802 for hybrid tuner pll access. */
users is always read or written with core->lock held. A plain int is simpler and faster. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> --- Thanks for reading. drivers/media/video/cx88/cx88-video.c | 5 +++-- drivers/media/video/cx88/cx88.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)