aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/gspca.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-12-02 05:14:33 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-15 21:18:01 -0500
commit8c4ebae45f8fa189746656a71d8a0ed21d569344 (patch)
tree85f467b7ffa8452d62423d0c9c6790a4c828f6ac /drivers/media/video/gspca/gspca.c
parentc4322bfca8907109689eb6b244258bf52277f7dc (diff)
V4L/DVB (13566): gspca - main: New variable usb_err for USB exchanges.
Signed-off-by: Jean-Francois 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.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index e6e8df484851..95a8b84d4cf0 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -767,6 +767,7 @@ static int vidioc_g_register(struct file *file, void *priv,
767 767
768 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) 768 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
769 return -ERESTARTSYS; 769 return -ERESTARTSYS;
770 gspca_dev->usb_err = 0;
770 if (gspca_dev->present) 771 if (gspca_dev->present)
771 ret = gspca_dev->sd_desc->get_register(gspca_dev, reg); 772 ret = gspca_dev->sd_desc->get_register(gspca_dev, reg);
772 else 773 else
@@ -790,6 +791,7 @@ static int vidioc_s_register(struct file *file, void *priv,
790 791
791 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) 792 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
792 return -ERESTARTSYS; 793 return -ERESTARTSYS;
794 gspca_dev->usb_err = 0;
793 if (gspca_dev->present) 795 if (gspca_dev->present)
794 ret = gspca_dev->sd_desc->set_register(gspca_dev, reg); 796 ret = gspca_dev->sd_desc->set_register(gspca_dev, reg);
795 else 797 else
@@ -811,6 +813,7 @@ static int vidioc_g_chip_ident(struct file *file, void *priv,
811 813
812 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) 814 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
813 return -ERESTARTSYS; 815 return -ERESTARTSYS;
816 gspca_dev->usb_err = 0;
814 if (gspca_dev->present) 817 if (gspca_dev->present)
815 ret = gspca_dev->sd_desc->get_chip_ident(gspca_dev, chip); 818 ret = gspca_dev->sd_desc->get_chip_ident(gspca_dev, chip);
816 else 819 else
@@ -1081,6 +1084,7 @@ static int dev_close(struct file *file)
1081 if (gspca_dev->capt_file == file) { 1084 if (gspca_dev->capt_file == file) {
1082 if (gspca_dev->streaming) { 1085 if (gspca_dev->streaming) {
1083 mutex_lock(&gspca_dev->usb_lock); 1086 mutex_lock(&gspca_dev->usb_lock);
1087 gspca_dev->usb_err = 0;
1084 gspca_stream_off(gspca_dev); 1088 gspca_stream_off(gspca_dev);
1085 mutex_unlock(&gspca_dev->usb_lock); 1089 mutex_unlock(&gspca_dev->usb_lock);
1086 } 1090 }
@@ -1200,6 +1204,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
1200 PDEBUG(D_CONF, "set ctrl [%08x] = %d", ctrl->id, ctrl->value); 1204 PDEBUG(D_CONF, "set ctrl [%08x] = %d", ctrl->id, ctrl->value);
1201 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) 1205 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
1202 return -ERESTARTSYS; 1206 return -ERESTARTSYS;
1207 gspca_dev->usb_err = 0;
1203 if (gspca_dev->present) 1208 if (gspca_dev->present)
1204 ret = ctrls->set(gspca_dev, ctrl->value); 1209 ret = ctrls->set(gspca_dev, ctrl->value);
1205 else 1210 else
@@ -1221,6 +1226,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
1221 1226
1222 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) 1227 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
1223 return -ERESTARTSYS; 1228 return -ERESTARTSYS;
1229 gspca_dev->usb_err = 0;
1224 if (gspca_dev->present) 1230 if (gspca_dev->present)
1225 ret = ctrls->get(gspca_dev, &ctrl->value); 1231 ret = ctrls->get(gspca_dev, &ctrl->value);
1226 else 1232 else
@@ -1335,6 +1341,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
1335 /* stop streaming */ 1341 /* stop streaming */
1336 if (gspca_dev->streaming) { 1342 if (gspca_dev->streaming) {
1337 mutex_lock(&gspca_dev->usb_lock); 1343 mutex_lock(&gspca_dev->usb_lock);
1344 gspca_dev->usb_err = 0;
1338 gspca_stream_off(gspca_dev); 1345 gspca_stream_off(gspca_dev);
1339 mutex_unlock(&gspca_dev->usb_lock); 1346 mutex_unlock(&gspca_dev->usb_lock);
1340 } 1347 }
@@ -1426,6 +1433,7 @@ static int vidioc_streamoff(struct file *file, void *priv,
1426 ret = -ERESTARTSYS; 1433 ret = -ERESTARTSYS;
1427 goto out; 1434 goto out;
1428 } 1435 }
1436 gspca_dev->usb_err = 0;
1429 gspca_stream_off(gspca_dev); 1437 gspca_stream_off(gspca_dev);
1430 mutex_unlock(&gspca_dev->usb_lock); 1438 mutex_unlock(&gspca_dev->usb_lock);
1431 1439
@@ -1451,6 +1459,7 @@ static int vidioc_g_jpegcomp(struct file *file, void *priv,
1451 return -EINVAL; 1459 return -EINVAL;
1452 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) 1460 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
1453 return -ERESTARTSYS; 1461 return -ERESTARTSYS;
1462 gspca_dev->usb_err = 0;
1454 if (gspca_dev->present) 1463 if (gspca_dev->present)
1455 ret = gspca_dev->sd_desc->get_jcomp(gspca_dev, jpegcomp); 1464 ret = gspca_dev->sd_desc->get_jcomp(gspca_dev, jpegcomp);
1456 else 1465 else
@@ -1469,6 +1478,7 @@ static int vidioc_s_jpegcomp(struct file *file, void *priv,
1469 return -EINVAL; 1478 return -EINVAL;
1470 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) 1479 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
1471 return -ERESTARTSYS; 1480 return -ERESTARTSYS;
1481 gspca_dev->usb_err = 0;
1472 if (gspca_dev->present) 1482 if (gspca_dev->present)
1473 ret = gspca_dev->sd_desc->set_jcomp(gspca_dev, jpegcomp); 1483 ret = gspca_dev->sd_desc->set_jcomp(gspca_dev, jpegcomp);
1474 else 1484 else
@@ -1489,6 +1499,7 @@ static int vidioc_g_parm(struct file *filp, void *priv,
1489 1499
1490 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) 1500 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
1491 return -ERESTARTSYS; 1501 return -ERESTARTSYS;
1502 gspca_dev->usb_err = 0;
1492 if (gspca_dev->present) 1503 if (gspca_dev->present)
1493 ret = gspca_dev->sd_desc->get_streamparm(gspca_dev, 1504 ret = gspca_dev->sd_desc->get_streamparm(gspca_dev,
1494 parm); 1505 parm);
@@ -1518,6 +1529,7 @@ static int vidioc_s_parm(struct file *filp, void *priv,
1518 1529
1519 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) 1530 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
1520 return -ERESTARTSYS; 1531 return -ERESTARTSYS;
1532 gspca_dev->usb_err = 0;
1521 if (gspca_dev->present) 1533 if (gspca_dev->present)
1522 ret = gspca_dev->sd_desc->set_streamparm(gspca_dev, 1534 ret = gspca_dev->sd_desc->set_streamparm(gspca_dev,
1523 parm); 1535 parm);
@@ -1689,6 +1701,7 @@ static int frame_wait(struct gspca_dev *gspca_dev,
1689 1701
1690 if (gspca_dev->sd_desc->dq_callback) { 1702 if (gspca_dev->sd_desc->dq_callback) {
1691 mutex_lock(&gspca_dev->usb_lock); 1703 mutex_lock(&gspca_dev->usb_lock);
1704 gspca_dev->usb_err = 0;
1692 if (gspca_dev->present) 1705 if (gspca_dev->present)
1693 gspca_dev->sd_desc->dq_callback(gspca_dev); 1706 gspca_dev->sd_desc->dq_callback(gspca_dev);
1694 mutex_unlock(&gspca_dev->usb_lock); 1707 mutex_unlock(&gspca_dev->usb_lock);