diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-12-25 11:46:14 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-29 05:17:06 -0500 |
commit | 668f44a603dd4b3468cecd7d8d6dc525207db94e (patch) | |
tree | a24f12a1a9064578e4ba02685bc9e18fb013906d /drivers/media/video/gspca/gspca.c | |
parent | 76ebc16b87592350e4ea70681855171adf73f055 (diff) |
[media] gspca: Use the global error status for get/set streamparm
Also, in ov534, don't check the parm type.
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 03381c68b986..92b5dfb12ed1 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -1708,12 +1708,13 @@ static int vidioc_g_parm(struct file *filp, void *priv, | |||
1708 | 1708 | ||
1709 | if (mutex_lock_interruptible(&gspca_dev->usb_lock)) | 1709 | if (mutex_lock_interruptible(&gspca_dev->usb_lock)) |
1710 | return -ERESTARTSYS; | 1710 | return -ERESTARTSYS; |
1711 | gspca_dev->usb_err = 0; | 1711 | if (gspca_dev->present) { |
1712 | if (gspca_dev->present) | 1712 | gspca_dev->usb_err = 0; |
1713 | ret = gspca_dev->sd_desc->get_streamparm(gspca_dev, | 1713 | gspca_dev->sd_desc->get_streamparm(gspca_dev, parm); |
1714 | parm); | 1714 | ret = gspca_dev->usb_err; |
1715 | else | 1715 | } else { |
1716 | ret = -ENODEV; | 1716 | ret = -ENODEV; |
1717 | } | ||
1717 | mutex_unlock(&gspca_dev->usb_lock); | 1718 | mutex_unlock(&gspca_dev->usb_lock); |
1718 | return ret; | 1719 | return ret; |
1719 | } | 1720 | } |
@@ -1738,12 +1739,13 @@ static int vidioc_s_parm(struct file *filp, void *priv, | |||
1738 | 1739 | ||
1739 | if (mutex_lock_interruptible(&gspca_dev->usb_lock)) | 1740 | if (mutex_lock_interruptible(&gspca_dev->usb_lock)) |
1740 | return -ERESTARTSYS; | 1741 | return -ERESTARTSYS; |
1741 | gspca_dev->usb_err = 0; | 1742 | if (gspca_dev->present) { |
1742 | if (gspca_dev->present) | 1743 | gspca_dev->usb_err = 0; |
1743 | ret = gspca_dev->sd_desc->set_streamparm(gspca_dev, | 1744 | gspca_dev->sd_desc->set_streamparm(gspca_dev, parm); |
1744 | parm); | 1745 | ret = gspca_dev->usb_err; |
1745 | else | 1746 | } else { |
1746 | ret = -ENODEV; | 1747 | ret = -ENODEV; |
1748 | } | ||
1747 | mutex_unlock(&gspca_dev->usb_lock); | 1749 | mutex_unlock(&gspca_dev->usb_lock); |
1748 | return ret; | 1750 | return ret; |
1749 | } | 1751 | } |