summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-10-01 13:13:56 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-01 13:13:56 -0300
commitb7d150678426686774ff4ee8365061eeefe7f021 (patch)
treed65c2179cd112cd7289ff65690df8c3e5b1a1ed1 /linux/drivers/media/video
parent8d420c25b3747f612563ce8706add4ffb84be126 (diff)
parent1bded05663a0aea1702e531a19694c6b670dc7d2 (diff)
downloadmediapointer-dvb-s2-b7d150678426686774ff4ee8365061eeefe7f021.tar.gz
mediapointer-dvb-s2-b7d150678426686774ff4ee8365061eeefe7f021.tar.bz2
merge: http://www.linuxtv.org/hg/~stoth/s2
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/cx88/cx88-video.c5
-rw-r--r--linux/drivers/media/video/cx88/cx88.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c
index 3a7a9ed17..c4fdb6da2 100644
--- a/linux/drivers/media/video/cx88/cx88-video.c
+++ b/linux/drivers/media/video/cx88/cx88-video.c
@@ -1065,6 +1065,8 @@ static int video_open(struct inode *inode, struct file *file)
}
unlock_kernel();
+ atomic_inc(&core->users);
+
return 0;
}
@@ -1152,7 +1154,8 @@ static int video_release(struct inode *inode, struct file *file)
file->private_data = NULL;
kfree(fh);
- cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL);
+ if(atomic_dec_and_test(&dev->core->users))
+ cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL);
return 0;
}
diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h
index b138b58e3..e42ce0016 100644
--- a/linux/drivers/media/video/cx88/cx88.h
+++ b/linux/drivers/media/video/cx88/cx88.h
@@ -353,6 +353,7 @@ struct cx88_core {
struct mutex lock;
/* various v4l controls */
u32 freq;
+ atomic_t users;
/* cx88-video needs to access cx8802 for hybrid tuner pll access. */
struct cx8802_dev *dvbdev;