aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/gspca.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r--drivers/media/video/gspca/gspca.c22
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 }