aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7134')
-rw-r--r--drivers/media/video/saa7134/saa7134-alsa.c6
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c8
-rw-r--r--drivers/media/video/saa7134/saa7134-oss.c40
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c40
-rw-r--r--drivers/media/video/saa7134/saa7134.h5
6 files changed, 51 insertions, 50 deletions
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c
index a7a6ab9298a9..d3c7345a5d22 100644
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@ -609,12 +609,12 @@ static int snd_card_saa7134_capture_open(snd_pcm_substream_t * substream)
609 struct saa7134_dev *dev = saa7134->dev; 609 struct saa7134_dev *dev = saa7134->dev;
610 int err; 610 int err;
611 611
612 down(&dev->dmasound.lock); 612 mutex_lock(&dev->dmasound.lock);
613 613
614 dev->dmasound.read_count = 0; 614 dev->dmasound.read_count = 0;
615 dev->dmasound.read_offset = 0; 615 dev->dmasound.read_offset = 0;
616 616
617 up(&dev->dmasound.lock); 617 mutex_unlock(&dev->dmasound.lock);
618 618
619 pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); 619 pcm = kzalloc(sizeof(*pcm), GFP_KERNEL);
620 if (pcm == NULL) 620 if (pcm == NULL)
@@ -932,7 +932,7 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
932 932
933 chip->irq = dev->pci->irq; 933 chip->irq = dev->pci->irq;
934 934
935 init_MUTEX(&dev->dmasound.lock); 935 mutex_init(&dev->dmasound.lock);
936 936
937 if ((err = snd_card_saa7134_new_mixer(chip)) < 0) 937 if ((err = snd_card_saa7134_new_mixer(chip)) < 0)
938 goto __nodev; 938 goto __nodev;
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 028904bd94a2..e7c30665739e 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -613,7 +613,7 @@ static int saa7134_hwinit1(struct saa7134_dev *dev)
613 613
614 saa_writel(SAA7134_IRQ1, 0); 614 saa_writel(SAA7134_IRQ1, 0);
615 saa_writel(SAA7134_IRQ2, 0); 615 saa_writel(SAA7134_IRQ2, 0);
616 init_MUTEX(&dev->lock); 616 mutex_init(&dev->lock);
617 spin_lock_init(&dev->slock); 617 spin_lock_init(&dev->slock);
618 618
619 saa7134_track_gpio(dev,"pre-init"); 619 saa7134_track_gpio(dev,"pre-init");
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index bd4c389d4c37..1d972edb3be6 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -89,7 +89,7 @@ static int ts_open(struct inode *inode, struct file *file)
89 89
90 dprintk("open minor=%d\n",minor); 90 dprintk("open minor=%d\n",minor);
91 err = -EBUSY; 91 err = -EBUSY;
92 if (down_trylock(&dev->empress_tsq.lock)) 92 if (!mutex_trylock(&dev->empress_tsq.lock))
93 goto done; 93 goto done;
94 if (dev->empress_users) 94 if (dev->empress_users)
95 goto done_up; 95 goto done_up;
@@ -99,7 +99,7 @@ static int ts_open(struct inode *inode, struct file *file)
99 err = 0; 99 err = 0;
100 100
101done_up: 101done_up:
102 up(&dev->empress_tsq.lock); 102 mutex_unlock(&dev->empress_tsq.lock);
103done: 103done:
104 return err; 104 return err;
105} 105}
@@ -110,7 +110,7 @@ static int ts_release(struct inode *inode, struct file *file)
110 110
111 if (dev->empress_tsq.streaming) 111 if (dev->empress_tsq.streaming)
112 videobuf_streamoff(&dev->empress_tsq); 112 videobuf_streamoff(&dev->empress_tsq);
113 down(&dev->empress_tsq.lock); 113 mutex_lock(&dev->empress_tsq.lock);
114 if (dev->empress_tsq.reading) 114 if (dev->empress_tsq.reading)
115 videobuf_read_stop(&dev->empress_tsq); 115 videobuf_read_stop(&dev->empress_tsq);
116 videobuf_mmap_free(&dev->empress_tsq); 116 videobuf_mmap_free(&dev->empress_tsq);
@@ -119,7 +119,7 @@ static int ts_release(struct inode *inode, struct file *file)
119 /* stop the encoder */ 119 /* stop the encoder */
120 ts_reset_encoder(dev); 120 ts_reset_encoder(dev);
121 121
122 up(&dev->empress_tsq.lock); 122 mutex_unlock(&dev->empress_tsq.lock);
123 return 0; 123 return 0;
124} 124}
125 125
diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c
index 7448e386a804..80e34a5fdcc5 100644
--- a/drivers/media/video/saa7134/saa7134-oss.c
+++ b/drivers/media/video/saa7134/saa7134-oss.c
@@ -254,7 +254,7 @@ static int dsp_open(struct inode *inode, struct file *file)
254 if (NULL == dev) 254 if (NULL == dev)
255 return -ENODEV; 255 return -ENODEV;
256 256
257 down(&dev->dmasound.lock); 257 mutex_lock(&dev->dmasound.lock);
258 err = -EBUSY; 258 err = -EBUSY;
259 if (dev->dmasound.users_dsp) 259 if (dev->dmasound.users_dsp)
260 goto fail1; 260 goto fail1;
@@ -270,13 +270,13 @@ static int dsp_open(struct inode *inode, struct file *file)
270 if (0 != err) 270 if (0 != err)
271 goto fail2; 271 goto fail2;
272 272
273 up(&dev->dmasound.lock); 273 mutex_unlock(&dev->dmasound.lock);
274 return 0; 274 return 0;
275 275
276 fail2: 276 fail2:
277 dev->dmasound.users_dsp--; 277 dev->dmasound.users_dsp--;
278 fail1: 278 fail1:
279 up(&dev->dmasound.lock); 279 mutex_unlock(&dev->dmasound.lock);
280 return err; 280 return err;
281} 281}
282 282
@@ -284,13 +284,13 @@ static int dsp_release(struct inode *inode, struct file *file)
284{ 284{
285 struct saa7134_dev *dev = file->private_data; 285 struct saa7134_dev *dev = file->private_data;
286 286
287 down(&dev->dmasound.lock); 287 mutex_lock(&dev->dmasound.lock);
288 if (dev->dmasound.recording_on) 288 if (dev->dmasound.recording_on)
289 dsp_rec_stop(dev); 289 dsp_rec_stop(dev);
290 dsp_buffer_free(dev); 290 dsp_buffer_free(dev);
291 dev->dmasound.users_dsp--; 291 dev->dmasound.users_dsp--;
292 file->private_data = NULL; 292 file->private_data = NULL;
293 up(&dev->dmasound.lock); 293 mutex_unlock(&dev->dmasound.lock);
294 return 0; 294 return 0;
295} 295}
296 296
@@ -304,7 +304,7 @@ static ssize_t dsp_read(struct file *file, char __user *buffer,
304 int err,ret = 0; 304 int err,ret = 0;
305 305
306 add_wait_queue(&dev->dmasound.wq, &wait); 306 add_wait_queue(&dev->dmasound.wq, &wait);
307 down(&dev->dmasound.lock); 307 mutex_lock(&dev->dmasound.lock);
308 while (count > 0) { 308 while (count > 0) {
309 /* wait for data if needed */ 309 /* wait for data if needed */
310 if (0 == dev->dmasound.read_count) { 310 if (0 == dev->dmasound.read_count) {
@@ -328,12 +328,12 @@ static ssize_t dsp_read(struct file *file, char __user *buffer,
328 ret = -EAGAIN; 328 ret = -EAGAIN;
329 break; 329 break;
330 } 330 }
331 up(&dev->dmasound.lock); 331 mutex_unlock(&dev->dmasound.lock);
332 set_current_state(TASK_INTERRUPTIBLE); 332 set_current_state(TASK_INTERRUPTIBLE);
333 if (0 == dev->dmasound.read_count) 333 if (0 == dev->dmasound.read_count)
334 schedule(); 334 schedule();
335 set_current_state(TASK_RUNNING); 335 set_current_state(TASK_RUNNING);
336 down(&dev->dmasound.lock); 336 mutex_lock(&dev->dmasound.lock);
337 if (signal_pending(current)) { 337 if (signal_pending(current)) {
338 if (0 == ret) 338 if (0 == ret)
339 ret = -EINTR; 339 ret = -EINTR;
@@ -362,7 +362,7 @@ static ssize_t dsp_read(struct file *file, char __user *buffer,
362 if (dev->dmasound.read_offset == dev->dmasound.bufsize) 362 if (dev->dmasound.read_offset == dev->dmasound.bufsize)
363 dev->dmasound.read_offset = 0; 363 dev->dmasound.read_offset = 0;
364 } 364 }
365 up(&dev->dmasound.lock); 365 mutex_unlock(&dev->dmasound.lock);
366 remove_wait_queue(&dev->dmasound.wq, &wait); 366 remove_wait_queue(&dev->dmasound.wq, &wait);
367 return ret; 367 return ret;
368} 368}
@@ -435,13 +435,13 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
435 case SNDCTL_DSP_STEREO: 435 case SNDCTL_DSP_STEREO:
436 if (get_user(val, p)) 436 if (get_user(val, p))
437 return -EFAULT; 437 return -EFAULT;
438 down(&dev->dmasound.lock); 438 mutex_lock(&dev->dmasound.lock);
439 dev->dmasound.channels = val ? 2 : 1; 439 dev->dmasound.channels = val ? 2 : 1;
440 if (dev->dmasound.recording_on) { 440 if (dev->dmasound.recording_on) {
441 dsp_rec_stop(dev); 441 dsp_rec_stop(dev);
442 dsp_rec_start(dev); 442 dsp_rec_start(dev);
443 } 443 }
444 up(&dev->dmasound.lock); 444 mutex_unlock(&dev->dmasound.lock);
445 return put_user(dev->dmasound.channels-1, p); 445 return put_user(dev->dmasound.channels-1, p);
446 446
447 case SNDCTL_DSP_CHANNELS: 447 case SNDCTL_DSP_CHANNELS:
@@ -449,13 +449,13 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
449 return -EFAULT; 449 return -EFAULT;
450 if (val != 1 && val != 2) 450 if (val != 1 && val != 2)
451 return -EINVAL; 451 return -EINVAL;
452 down(&dev->dmasound.lock); 452 mutex_lock(&dev->dmasound.lock);
453 dev->dmasound.channels = val; 453 dev->dmasound.channels = val;
454 if (dev->dmasound.recording_on) { 454 if (dev->dmasound.recording_on) {
455 dsp_rec_stop(dev); 455 dsp_rec_stop(dev);
456 dsp_rec_start(dev); 456 dsp_rec_start(dev);
457 } 457 }
458 up(&dev->dmasound.lock); 458 mutex_unlock(&dev->dmasound.lock);
459 /* fall through */ 459 /* fall through */
460 case SOUND_PCM_READ_CHANNELS: 460 case SOUND_PCM_READ_CHANNELS:
461 return put_user(dev->dmasound.channels, p); 461 return put_user(dev->dmasound.channels, p);
@@ -478,13 +478,13 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
478 case AFMT_U16_BE: 478 case AFMT_U16_BE:
479 case AFMT_S16_LE: 479 case AFMT_S16_LE:
480 case AFMT_S16_BE: 480 case AFMT_S16_BE:
481 down(&dev->dmasound.lock); 481 mutex_lock(&dev->dmasound.lock);
482 dev->dmasound.afmt = val; 482 dev->dmasound.afmt = val;
483 if (dev->dmasound.recording_on) { 483 if (dev->dmasound.recording_on) {
484 dsp_rec_stop(dev); 484 dsp_rec_stop(dev);
485 dsp_rec_start(dev); 485 dsp_rec_start(dev);
486 } 486 }
487 up(&dev->dmasound.lock); 487 mutex_unlock(&dev->dmasound.lock);
488 return put_user(dev->dmasound.afmt, p); 488 return put_user(dev->dmasound.afmt, p);
489 default: 489 default:
490 return -EINVAL; 490 return -EINVAL;
@@ -509,10 +509,10 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
509 return 0; 509 return 0;
510 510
511 case SNDCTL_DSP_RESET: 511 case SNDCTL_DSP_RESET:
512 down(&dev->dmasound.lock); 512 mutex_lock(&dev->dmasound.lock);
513 if (dev->dmasound.recording_on) 513 if (dev->dmasound.recording_on)
514 dsp_rec_stop(dev); 514 dsp_rec_stop(dev);
515 up(&dev->dmasound.lock); 515 mutex_unlock(&dev->dmasound.lock);
516 return 0; 516 return 0;
517 case SNDCTL_DSP_GETBLKSIZE: 517 case SNDCTL_DSP_GETBLKSIZE:
518 return put_user(dev->dmasound.blksize, p); 518 return put_user(dev->dmasound.blksize, p);
@@ -556,10 +556,10 @@ static unsigned int dsp_poll(struct file *file, struct poll_table_struct *wait)
556 poll_wait(file, &dev->dmasound.wq, wait); 556 poll_wait(file, &dev->dmasound.wq, wait);
557 557
558 if (0 == dev->dmasound.read_count) { 558 if (0 == dev->dmasound.read_count) {
559 down(&dev->dmasound.lock); 559 mutex_lock(&dev->dmasound.lock);
560 if (!dev->dmasound.recording_on) 560 if (!dev->dmasound.recording_on)
561 dsp_rec_start(dev); 561 dsp_rec_start(dev);
562 up(&dev->dmasound.lock); 562 mutex_unlock(&dev->dmasound.lock);
563 } else 563 } else
564 mask |= (POLLIN | POLLRDNORM); 564 mask |= (POLLIN | POLLRDNORM);
565 return mask; 565 return mask;
@@ -852,7 +852,7 @@ int saa7134_oss_init1(struct saa7134_dev *dev)
852 return -1; 852 return -1;
853 853
854 /* general */ 854 /* general */
855 init_MUTEX(&dev->dmasound.lock); 855 mutex_init(&dev->dmasound.lock);
856 init_waitqueue_head(&dev->dmasound.wq); 856 init_waitqueue_head(&dev->dmasound.wq);
857 857
858 switch (dev->pci->device) { 858 switch (dev->pci->device) {
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index e97426bc85df..72f389a51a13 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -460,17 +460,17 @@ static int res_get(struct saa7134_dev *dev, struct saa7134_fh *fh, unsigned int
460 return 1; 460 return 1;
461 461
462 /* is it free? */ 462 /* is it free? */
463 down(&dev->lock); 463 mutex_lock(&dev->lock);
464 if (dev->resources & bit) { 464 if (dev->resources & bit) {
465 /* no, someone else uses it */ 465 /* no, someone else uses it */
466 up(&dev->lock); 466 mutex_unlock(&dev->lock);
467 return 0; 467 return 0;
468 } 468 }
469 /* it's free, grab it */ 469 /* it's free, grab it */
470 fh->resources |= bit; 470 fh->resources |= bit;
471 dev->resources |= bit; 471 dev->resources |= bit;
472 dprintk("res: get %d\n",bit); 472 dprintk("res: get %d\n",bit);
473 up(&dev->lock); 473 mutex_unlock(&dev->lock);
474 return 1; 474 return 1;
475} 475}
476 476
@@ -492,11 +492,11 @@ void res_free(struct saa7134_dev *dev, struct saa7134_fh *fh, unsigned int bits)
492 if ((fh->resources & bits) != bits) 492 if ((fh->resources & bits) != bits)
493 BUG(); 493 BUG();
494 494
495 down(&dev->lock); 495 mutex_lock(&dev->lock);
496 fh->resources &= ~bits; 496 fh->resources &= ~bits;
497 dev->resources &= ~bits; 497 dev->resources &= ~bits;
498 dprintk("res: put %d\n",bits); 498 dprintk("res: put %d\n",bits);
499 up(&dev->lock); 499 mutex_unlock(&dev->lock);
500} 500}
501 501
502/* ------------------------------------------------------------------ */ 502/* ------------------------------------------------------------------ */
@@ -1340,21 +1340,21 @@ video_poll(struct file *file, struct poll_table_struct *wait)
1340 if (!list_empty(&fh->cap.stream)) 1340 if (!list_empty(&fh->cap.stream))
1341 buf = list_entry(fh->cap.stream.next, struct videobuf_buffer, stream); 1341 buf = list_entry(fh->cap.stream.next, struct videobuf_buffer, stream);
1342 } else { 1342 } else {
1343 down(&fh->cap.lock); 1343 mutex_lock(&fh->cap.lock);
1344 if (UNSET == fh->cap.read_off) { 1344 if (UNSET == fh->cap.read_off) {
1345 /* need to capture a new frame */ 1345 /* need to capture a new frame */
1346 if (res_locked(fh->dev,RESOURCE_VIDEO)) { 1346 if (res_locked(fh->dev,RESOURCE_VIDEO)) {
1347 up(&fh->cap.lock); 1347 mutex_unlock(&fh->cap.lock);
1348 return POLLERR; 1348 return POLLERR;
1349 } 1349 }
1350 if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,fh->cap.field)) { 1350 if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,fh->cap.field)) {
1351 up(&fh->cap.lock); 1351 mutex_unlock(&fh->cap.lock);
1352 return POLLERR; 1352 return POLLERR;
1353 } 1353 }
1354 fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf); 1354 fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf);
1355 fh->cap.read_off = 0; 1355 fh->cap.read_off = 0;
1356 } 1356 }
1357 up(&fh->cap.lock); 1357 mutex_unlock(&fh->cap.lock);
1358 buf = fh->cap.read_buf; 1358 buf = fh->cap.read_buf;
1359 } 1359 }
1360 1360
@@ -1561,14 +1561,14 @@ static int saa7134_s_fmt(struct saa7134_dev *dev, struct saa7134_fh *fh,
1561 if (0 != err) 1561 if (0 != err)
1562 return err; 1562 return err;
1563 1563
1564 down(&dev->lock); 1564 mutex_lock(&dev->lock);
1565 fh->win = f->fmt.win; 1565 fh->win = f->fmt.win;
1566 fh->nclips = f->fmt.win.clipcount; 1566 fh->nclips = f->fmt.win.clipcount;
1567 if (fh->nclips > 8) 1567 if (fh->nclips > 8)
1568 fh->nclips = 8; 1568 fh->nclips = 8;
1569 if (copy_from_user(fh->clips,f->fmt.win.clips, 1569 if (copy_from_user(fh->clips,f->fmt.win.clips,
1570 sizeof(struct v4l2_clip)*fh->nclips)) { 1570 sizeof(struct v4l2_clip)*fh->nclips)) {
1571 up(&dev->lock); 1571 mutex_unlock(&dev->lock);
1572 return -EFAULT; 1572 return -EFAULT;
1573 } 1573 }
1574 1574
@@ -1578,7 +1578,7 @@ static int saa7134_s_fmt(struct saa7134_dev *dev, struct saa7134_fh *fh,
1578 start_preview(dev,fh); 1578 start_preview(dev,fh);
1579 spin_unlock_irqrestore(&dev->slock,flags); 1579 spin_unlock_irqrestore(&dev->slock,flags);
1580 } 1580 }
1581 up(&dev->lock); 1581 mutex_unlock(&dev->lock);
1582 return 0; 1582 return 0;
1583 case V4L2_BUF_TYPE_VBI_CAPTURE: 1583 case V4L2_BUF_TYPE_VBI_CAPTURE:
1584 saa7134_vbi_fmt(dev,f); 1584 saa7134_vbi_fmt(dev,f);
@@ -1612,9 +1612,9 @@ int saa7134_common_ioctl(struct saa7134_dev *dev,
1612 return get_control(dev,arg); 1612 return get_control(dev,arg);
1613 case VIDIOC_S_CTRL: 1613 case VIDIOC_S_CTRL:
1614 { 1614 {
1615 down(&dev->lock); 1615 mutex_lock(&dev->lock);
1616 err = set_control(dev,NULL,arg); 1616 err = set_control(dev,NULL,arg);
1617 up(&dev->lock); 1617 mutex_unlock(&dev->lock);
1618 return err; 1618 return err;
1619 } 1619 }
1620 /* --- input switching --------------------------------------- */ 1620 /* --- input switching --------------------------------------- */
@@ -1664,9 +1664,9 @@ int saa7134_common_ioctl(struct saa7134_dev *dev,
1664 return -EINVAL; 1664 return -EINVAL;
1665 if (NULL == card_in(dev,*i).name) 1665 if (NULL == card_in(dev,*i).name)
1666 return -EINVAL; 1666 return -EINVAL;
1667 down(&dev->lock); 1667 mutex_lock(&dev->lock);
1668 video_mux(dev,*i); 1668 video_mux(dev,*i);
1669 up(&dev->lock); 1669 mutex_unlock(&dev->lock);
1670 return 0; 1670 return 0;
1671 } 1671 }
1672 1672
@@ -1766,7 +1766,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1766 if (i == TVNORMS) 1766 if (i == TVNORMS)
1767 return -EINVAL; 1767 return -EINVAL;
1768 1768
1769 down(&dev->lock); 1769 mutex_lock(&dev->lock);
1770 if (res_check(fh, RESOURCE_OVERLAY)) { 1770 if (res_check(fh, RESOURCE_OVERLAY)) {
1771 spin_lock_irqsave(&dev->slock,flags); 1771 spin_lock_irqsave(&dev->slock,flags);
1772 stop_preview(dev,fh); 1772 stop_preview(dev,fh);
@@ -1776,7 +1776,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1776 } else 1776 } else
1777 set_tvnorm(dev,&tvnorms[i]); 1777 set_tvnorm(dev,&tvnorms[i]);
1778 saa7134_tvaudio_do_scan(dev); 1778 saa7134_tvaudio_do_scan(dev);
1779 up(&dev->lock); 1779 mutex_unlock(&dev->lock);
1780 return 0; 1780 return 0;
1781 } 1781 }
1782 1782
@@ -1909,13 +1909,13 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1909 return -EINVAL; 1909 return -EINVAL;
1910 if (1 == fh->radio && V4L2_TUNER_RADIO != f->type) 1910 if (1 == fh->radio && V4L2_TUNER_RADIO != f->type)
1911 return -EINVAL; 1911 return -EINVAL;
1912 down(&dev->lock); 1912 mutex_lock(&dev->lock);
1913 dev->ctl_freq = f->frequency; 1913 dev->ctl_freq = f->frequency;
1914 1914
1915 saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,f); 1915 saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,f);
1916 1916
1917 saa7134_tvaudio_do_scan(dev); 1917 saa7134_tvaudio_do_scan(dev);
1918 up(&dev->lock); 1918 mutex_unlock(&dev->lock);
1919 return 0; 1919 return 0;
1920 } 1920 }
1921 1921
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index ff39a63c7372..691c10be459d 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -29,6 +29,7 @@
29#include <linux/input.h> 29#include <linux/input.h>
30#include <linux/notifier.h> 30#include <linux/notifier.h>
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/mutex.h>
32 33
33#include <asm/io.h> 34#include <asm/io.h>
34 35
@@ -364,7 +365,7 @@ struct saa7134_fh {
364 365
365/* dmasound dsp status */ 366/* dmasound dsp status */
366struct saa7134_dmasound { 367struct saa7134_dmasound {
367 struct semaphore lock; 368 struct mutex lock;
368 int minor_mixer; 369 int minor_mixer;
369 int minor_dsp; 370 int minor_dsp;
370 unsigned int users_dsp; 371 unsigned int users_dsp;
@@ -428,7 +429,7 @@ struct saa7134_mpeg_ops {
428/* global device status */ 429/* global device status */
429struct saa7134_dev { 430struct saa7134_dev {
430 struct list_head devlist; 431 struct list_head devlist;
431 struct semaphore lock; 432 struct mutex lock;
432 spinlock_t slock; 433 spinlock_t slock;
433#ifdef VIDIOC_G_PRIORITY 434#ifdef VIDIOC_G_PRIORITY
434 struct v4l2_prio_state prio; 435 struct v4l2_prio_state prio;