aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-video.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-02-07 03:49:14 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-02-07 03:49:14 -0500
commit3593cab5d62c4c7abced1076710f9bc2d8847433 (patch)
treedd5dc21961f6b4aef6900b0c2eb63ce7c70aecd5 /drivers/media/video/saa7134/saa7134-video.c
parent538f9630afbbe429ecbcdcf92536200293a8e4b3 (diff)
V4L/DVB (3318b): sem2mutex: drivers/media/, #2
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index e97426bc85d..72f389a51a1 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