summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-video.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2011-05-01 06:31:40 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-20 09:29:43 -0300
commit8d115931622eb19a15f2633cb35dd2c4a66db255 (patch)
tree23216f6e5fc4f71449369ad500824832d97ea8b9 /drivers/media/video/cx88/cx88-video.c
parentf4bd4be8d113534a28e0c9a86cddbabd47b06159 (diff)
downloadlinux-8d115931622eb19a15f2633cb35dd2c4a66db255.tar.gz
linux-8d115931622eb19a15f2633cb35dd2c4a66db255.tar.bz2
linux-8d115931622eb19a15f2633cb35dd2c4a66db255.zip
[media] cx88: don't use atomic_t for core->users
users is always read or written with core->lock held. A plain int is simpler and faster. Tested-by: Andi Huber <hobrom@gmx.at> Tested-by: Marlon de Boer <marlon@hyves.nl> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx88/cx88-video.c')
-rw-r--r--drivers/media/video/cx88/cx88-video.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index b1f734dccea0..cef4f282e5aa 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);