aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88')
-rw-r--r--drivers/media/video/cx88/cx88-core.c2
-rw-r--r--drivers/media/video/cx88/cx88-video.c26
-rw-r--r--drivers/media/video/cx88/cx88.h4
3 files changed, 16 insertions, 16 deletions
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index 3720f24a25cf..eda7cd8b2d4a 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -1061,7 +1061,7 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci)
1061 core->pci_bus = pci->bus->number; 1061 core->pci_bus = pci->bus->number;
1062 core->pci_slot = PCI_SLOT(pci->devfn); 1062 core->pci_slot = PCI_SLOT(pci->devfn);
1063 core->pci_irqmask = 0x00fc00; 1063 core->pci_irqmask = 0x00fc00;
1064 init_MUTEX(&core->lock); 1064 mutex_init(&core->lock);
1065 1065
1066 core->nr = cx88_devcount++; 1066 core->nr = cx88_devcount++;
1067 sprintf(core->name,"cx88[%d]",core->nr); 1067 sprintf(core->name,"cx88[%d]",core->nr);
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 073494ceab0f..d15ef158ac8f 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -336,17 +336,17 @@ static int res_get(struct cx8800_dev *dev, struct cx8800_fh *fh, unsigned int bi
336 return 1; 336 return 1;
337 337
338 /* is it free? */ 338 /* is it free? */
339 down(&core->lock); 339 mutex_lock(&core->lock);
340 if (dev->resources & bit) { 340 if (dev->resources & bit) {
341 /* no, someone else uses it */ 341 /* no, someone else uses it */
342 up(&core->lock); 342 mutex_unlock(&core->lock);
343 return 0; 343 return 0;
344 } 344 }
345 /* it's free, grab it */ 345 /* it's free, grab it */
346 fh->resources |= bit; 346 fh->resources |= bit;
347 dev->resources |= bit; 347 dev->resources |= bit;
348 dprintk(1,"res: get %d\n",bit); 348 dprintk(1,"res: get %d\n",bit);
349 up(&core->lock); 349 mutex_unlock(&core->lock);
350 return 1; 350 return 1;
351} 351}
352 352
@@ -369,11 +369,11 @@ void res_free(struct cx8800_dev *dev, struct cx8800_fh *fh, unsigned int bits)
369 if ((fh->resources & bits) != bits) 369 if ((fh->resources & bits) != bits)
370 BUG(); 370 BUG();
371 371
372 down(&core->lock); 372 mutex_lock(&core->lock);
373 fh->resources &= ~bits; 373 fh->resources &= ~bits;
374 dev->resources &= ~bits; 374 dev->resources &= ~bits;
375 dprintk(1,"res: put %d\n",bits); 375 dprintk(1,"res: put %d\n",bits);
376 up(&core->lock); 376 mutex_unlock(&core->lock);
377} 377}
378 378
379/* ------------------------------------------------------------------ */ 379/* ------------------------------------------------------------------ */
@@ -1291,9 +1291,9 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
1291 if (i == ARRAY_SIZE(tvnorms)) 1291 if (i == ARRAY_SIZE(tvnorms))
1292 return -EINVAL; 1292 return -EINVAL;
1293 1293
1294 down(&core->lock); 1294 mutex_lock(&core->lock);
1295 cx88_set_tvnorm(core,&tvnorms[i]); 1295 cx88_set_tvnorm(core,&tvnorms[i]);
1296 up(&core->lock); 1296 mutex_unlock(&core->lock);
1297 return 0; 1297 return 0;
1298 } 1298 }
1299 1299
@@ -1343,10 +1343,10 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
1343 1343
1344 if (*i >= 4) 1344 if (*i >= 4)
1345 return -EINVAL; 1345 return -EINVAL;
1346 down(&core->lock); 1346 mutex_lock(&core->lock);
1347 cx88_newstation(core); 1347 cx88_newstation(core);
1348 video_mux(core,*i); 1348 video_mux(core,*i);
1349 up(&core->lock); 1349 mutex_unlock(&core->lock);
1350 return 0; 1350 return 0;
1351 } 1351 }
1352 1352
@@ -1438,7 +1438,7 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
1438 return -EINVAL; 1438 return -EINVAL;
1439 if (1 == radio && f->type != V4L2_TUNER_RADIO) 1439 if (1 == radio && f->type != V4L2_TUNER_RADIO)
1440 return -EINVAL; 1440 return -EINVAL;
1441 down(&core->lock); 1441 mutex_lock(&core->lock);
1442 core->freq = f->frequency; 1442 core->freq = f->frequency;
1443 cx88_newstation(core); 1443 cx88_newstation(core);
1444 cx88_call_i2c_clients(core,VIDIOC_S_FREQUENCY,f); 1444 cx88_call_i2c_clients(core,VIDIOC_S_FREQUENCY,f);
@@ -1447,7 +1447,7 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
1447 msleep (10); 1447 msleep (10);
1448 cx88_set_tvaudio(core); 1448 cx88_set_tvaudio(core);
1449 1449
1450 up(&core->lock); 1450 mutex_unlock(&core->lock);
1451 return 0; 1451 return 0;
1452 } 1452 }
1453 1453
@@ -1921,11 +1921,11 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1921 pci_set_drvdata(pci_dev,dev); 1921 pci_set_drvdata(pci_dev,dev);
1922 1922
1923 /* initial device configuration */ 1923 /* initial device configuration */
1924 down(&core->lock); 1924 mutex_lock(&core->lock);
1925 cx88_set_tvnorm(core,tvnorms); 1925 cx88_set_tvnorm(core,tvnorms);
1926 init_controls(core); 1926 init_controls(core);
1927 video_mux(core,0); 1927 video_mux(core,0);
1928 up(&core->lock); 1928 mutex_unlock(&core->lock);
1929 1929
1930 /* start tvaudio thread */ 1930 /* start tvaudio thread */
1931 if (core->tuner_type != TUNER_ABSENT) 1931 if (core->tuner_type != TUNER_ABSENT)
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index 31a688a3fb77..a4cf2473eacf 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -35,6 +35,7 @@
35#include "cx88-reg.h" 35#include "cx88-reg.h"
36 36
37#include <linux/version.h> 37#include <linux/version.h>
38#include <linux/mutex.h>
38#define CX88_VERSION_CODE KERNEL_VERSION(0,0,5) 39#define CX88_VERSION_CODE KERNEL_VERSION(0,0,5)
39 40
40#ifndef TRUE 41#ifndef TRUE
@@ -309,8 +310,7 @@ struct cx88_core {
309 /* IR remote control state */ 310 /* IR remote control state */
310 struct cx88_IR *ir; 311 struct cx88_IR *ir;
311 312
312 struct semaphore lock; 313 struct mutex lock;
313
314 /* various v4l controls */ 314 /* various v4l controls */
315 u32 freq; 315 u32 freq;
316 316