Commit 8d115931 authored by Jonathan Nieder's avatar Jonathan Nieder Committed by Mauro Carvalho Chehab

[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: default avatarAndi Huber <hobrom@gmx.at>
Tested-by: default avatarMarlon de Boer <marlon@hyves.nl>
Signed-off-by: default avatarJonathan Nieder <jrnieder@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f4bd4be8
...@@ -824,7 +824,7 @@ static int video_open(struct file *file) ...@@ -824,7 +824,7 @@ static int video_open(struct file *file)
call_all(core, tuner, s_radio); call_all(core, tuner, s_radio);
} }
atomic_inc(&core->users); core->users++;
mutex_unlock(&core->lock); mutex_unlock(&core->lock);
return 0; return 0;
...@@ -922,7 +922,8 @@ static int video_release(struct file *file) ...@@ -922,7 +922,8 @@ static int video_release(struct file *file)
file->private_data = NULL; file->private_data = NULL;
kfree(fh); 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); call_all(dev->core, core, s_power, 0);
mutex_unlock(&dev->core->lock); mutex_unlock(&dev->core->lock);
......
...@@ -389,7 +389,7 @@ struct cx88_core { ...@@ -389,7 +389,7 @@ struct cx88_core {
struct mutex lock; struct mutex lock;
/* various v4l controls */ /* various v4l controls */
u32 freq; u32 freq;
atomic_t users; int users;
int mpeg_users; int mpeg_users;
/* cx88-video needs to access cx8802 for hybrid tuner pll access. */ /* cx88-video needs to access cx8802 for hybrid tuner pll access. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment