aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-video.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 17:03:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 17:03:59 -0400
commitcf2fa66055d718ae13e62451bb546505f63906a2 (patch)
treee206d3f04e74a34e9aa88d21af6c26eea21d4121 /drivers/media/video/cx88/cx88-video.c
parent4501a466f28788485604ee42641d7a5fe7258d16 (diff)
parent57f51dbc45f65f7ee1e8c8f77200bb8000e3e271 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (313 commits) V4L/DVB (9186): Added support for Prof 7300 DVB-S/S2 cards V4L/DVB (9185): S2API: Ensure we have a reasonable ROLLOFF default V4L/DVB (9184): cx24116: Change the default SNR units back to percentage by default. V4L/DVB (9183): S2API: Return error of the caller provides 0 commands. V4L/DVB (9182): S2API: Added support for DTV_HIERARCHY V4L/DVB (9181): S2API: Add support fot DTV_GUARD_INTERVAL and DTV_TRANSMISSION_MODE V4L/DVB (9180): S2API: Added support for DTV_CODE_RATE_HP/LP V4L/DVB (9179): S2API: frontend.h cleanup V4L/DVB (9178): cx24116: Add module parameter to return SNR as ESNO. V4L/DVB (9177): S2API: Change _8PSK / _16APSK to PSK_8 and APSK_16 V4L/DVB (9176): Add support for DvbWorld USB cards with STV0288 demodulator. V4L/DVB (9175): Remove NULL pointer in stb6000 driver. V4L/DVB (9174): Allow custom inittab for ST STV0288 demodulator. V4L/DVB (9173): S2API: Remove the hardcoded command limit during validation V4L/DVB (9172): S2API: Bugfix related to DVB-S / DVB-S2 tuning for the legacy API. V4L/DVB (9171): S2API: Stop an OOPS if illegal commands are dumped in S2API. V4L/DVB (9170): cx24116: Sanity checking to data input via S2API to the cx24116 demod. V4L/DVB (9169): uvcvideo: Support two new Bison Electronics webcams. V4L/DVB (9168): Add support for MSI TV@nywhere Plus remote V4L/DVB: v4l2-dev: remove duplicated #include ...
Diffstat (limited to 'drivers/media/video/cx88/cx88-video.c')
-rw-r--r--drivers/media/video/cx88/cx88-video.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index ef4d56ea0027..be45955dff68 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -773,6 +773,7 @@ static int video_open(struct inode *inode, struct file *file)
773 enum v4l2_buf_type type = 0; 773 enum v4l2_buf_type type = 0;
774 int radio = 0; 774 int radio = 0;
775 775
776 lock_kernel();
776 list_for_each_entry(h, &cx8800_devlist, devlist) { 777 list_for_each_entry(h, &cx8800_devlist, devlist) {
777 if (h->video_dev->minor == minor) { 778 if (h->video_dev->minor == minor) {
778 dev = h; 779 dev = h;
@@ -788,8 +789,10 @@ static int video_open(struct inode *inode, struct file *file)
788 dev = h; 789 dev = h;
789 } 790 }
790 } 791 }
791 if (NULL == dev) 792 if (NULL == dev) {
793 unlock_kernel();
792 return -ENODEV; 794 return -ENODEV;
795 }
793 796
794 core = dev->core; 797 core = dev->core;
795 798
@@ -798,8 +801,10 @@ static int video_open(struct inode *inode, struct file *file)
798 801
799 /* allocate + initialize per filehandle data */ 802 /* allocate + initialize per filehandle data */
800 fh = kzalloc(sizeof(*fh),GFP_KERNEL); 803 fh = kzalloc(sizeof(*fh),GFP_KERNEL);
801 if (NULL == fh) 804 if (NULL == fh) {
805 unlock_kernel();
802 return -ENOMEM; 806 return -ENOMEM;
807 }
803 file->private_data = fh; 808 file->private_data = fh;
804 fh->dev = dev; 809 fh->dev = dev;
805 fh->radio = radio; 810 fh->radio = radio;
@@ -832,6 +837,9 @@ static int video_open(struct inode *inode, struct file *file)
832 cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1); 837 cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1);
833 cx88_call_i2c_clients(core,AUDC_SET_RADIO,NULL); 838 cx88_call_i2c_clients(core,AUDC_SET_RADIO,NULL);
834 } 839 }
840 unlock_kernel();
841
842 atomic_inc(&core->users);
835 843
836 return 0; 844 return 0;
837} 845}
@@ -920,7 +928,8 @@ static int video_release(struct inode *inode, struct file *file)
920 file->private_data = NULL; 928 file->private_data = NULL;
921 kfree(fh); 929 kfree(fh);
922 930
923 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);
924 933
925 return 0; 934 return 0;
926} 935}