aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/cx88/cx88-video.c5
-rw-r--r--drivers/media/video/cx88/cx88.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 61e03d4703f6..be45955dff68 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -839,6 +839,8 @@ static int video_open(struct inode *inode, struct file *file)
839 } 839 }
840 unlock_kernel(); 840 unlock_kernel();
841 841
842 atomic_inc(&core->users);
843
842 return 0; 844 return 0;
843} 845}
844 846
@@ -926,7 +928,8 @@ static int video_release(struct inode *inode, struct file *file)
926 file->private_data = NULL; 928 file->private_data = NULL;
927 kfree(fh); 929 kfree(fh);
928 930
929 cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); 931 if(atomic_dec_and_test(&dev->core->users))
932 cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL);
930 933
931 return 0; 934 return 0;
932} 935}
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index 6420fb7615b1..dce7d36edb42 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -349,6 +349,7 @@ struct cx88_core {
349 struct mutex lock; 349 struct mutex lock;
350 /* various v4l controls */ 350 /* various v4l controls */
351 u32 freq; 351 u32 freq;
352 atomic_t users;
352 353
353 /* cx88-video needs to access cx8802 for hybrid tuner pll access. */ 354 /* cx88-video needs to access cx8802 for hybrid tuner pll access. */
354 struct cx8802_dev *dvbdev; 355 struct cx8802_dev *dvbdev;