Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176785
b: refs/heads/master
c: 8c4ebae
h: refs/heads/master
i:
  176783: 0e5d59c
v: v3
  • Loading branch information
Jean-Francois Moine authored and Mauro Carvalho Chehab committed Dec 16, 2009
1 parent 2b488a8 commit 4a4c92c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c4322bfca8907109689eb6b244258bf52277f7dc
refs/heads/master: 8c4ebae45f8fa189746656a71d8a0ed21d569344
13 changes: 13 additions & 0 deletions trunk/drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ static int vidioc_g_register(struct file *file, void *priv,

if (mutex_lock_interruptible(&gspca_dev->usb_lock))
return -ERESTARTSYS;
gspca_dev->usb_err = 0;
if (gspca_dev->present)
ret = gspca_dev->sd_desc->get_register(gspca_dev, reg);
else
Expand All @@ -790,6 +791,7 @@ static int vidioc_s_register(struct file *file, void *priv,

if (mutex_lock_interruptible(&gspca_dev->usb_lock))
return -ERESTARTSYS;
gspca_dev->usb_err = 0;
if (gspca_dev->present)
ret = gspca_dev->sd_desc->set_register(gspca_dev, reg);
else
Expand All @@ -811,6 +813,7 @@ static int vidioc_g_chip_ident(struct file *file, void *priv,

if (mutex_lock_interruptible(&gspca_dev->usb_lock))
return -ERESTARTSYS;
gspca_dev->usb_err = 0;
if (gspca_dev->present)
ret = gspca_dev->sd_desc->get_chip_ident(gspca_dev, chip);
else
Expand Down Expand Up @@ -1081,6 +1084,7 @@ static int dev_close(struct file *file)
if (gspca_dev->capt_file == file) {
if (gspca_dev->streaming) {
mutex_lock(&gspca_dev->usb_lock);
gspca_dev->usb_err = 0;
gspca_stream_off(gspca_dev);
mutex_unlock(&gspca_dev->usb_lock);
}
Expand Down Expand Up @@ -1200,6 +1204,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
PDEBUG(D_CONF, "set ctrl [%08x] = %d", ctrl->id, ctrl->value);
if (mutex_lock_interruptible(&gspca_dev->usb_lock))
return -ERESTARTSYS;
gspca_dev->usb_err = 0;
if (gspca_dev->present)
ret = ctrls->set(gspca_dev, ctrl->value);
else
Expand All @@ -1221,6 +1226,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,

if (mutex_lock_interruptible(&gspca_dev->usb_lock))
return -ERESTARTSYS;
gspca_dev->usb_err = 0;
if (gspca_dev->present)
ret = ctrls->get(gspca_dev, &ctrl->value);
else
Expand Down Expand Up @@ -1335,6 +1341,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
/* stop streaming */
if (gspca_dev->streaming) {
mutex_lock(&gspca_dev->usb_lock);
gspca_dev->usb_err = 0;
gspca_stream_off(gspca_dev);
mutex_unlock(&gspca_dev->usb_lock);
}
Expand Down Expand Up @@ -1426,6 +1433,7 @@ static int vidioc_streamoff(struct file *file, void *priv,
ret = -ERESTARTSYS;
goto out;
}
gspca_dev->usb_err = 0;
gspca_stream_off(gspca_dev);
mutex_unlock(&gspca_dev->usb_lock);

Expand All @@ -1451,6 +1459,7 @@ static int vidioc_g_jpegcomp(struct file *file, void *priv,
return -EINVAL;
if (mutex_lock_interruptible(&gspca_dev->usb_lock))
return -ERESTARTSYS;
gspca_dev->usb_err = 0;
if (gspca_dev->present)
ret = gspca_dev->sd_desc->get_jcomp(gspca_dev, jpegcomp);
else
Expand All @@ -1469,6 +1478,7 @@ static int vidioc_s_jpegcomp(struct file *file, void *priv,
return -EINVAL;
if (mutex_lock_interruptible(&gspca_dev->usb_lock))
return -ERESTARTSYS;
gspca_dev->usb_err = 0;
if (gspca_dev->present)
ret = gspca_dev->sd_desc->set_jcomp(gspca_dev, jpegcomp);
else
Expand All @@ -1489,6 +1499,7 @@ static int vidioc_g_parm(struct file *filp, void *priv,

if (mutex_lock_interruptible(&gspca_dev->usb_lock))
return -ERESTARTSYS;
gspca_dev->usb_err = 0;
if (gspca_dev->present)
ret = gspca_dev->sd_desc->get_streamparm(gspca_dev,
parm);
Expand Down Expand Up @@ -1518,6 +1529,7 @@ static int vidioc_s_parm(struct file *filp, void *priv,

if (mutex_lock_interruptible(&gspca_dev->usb_lock))
return -ERESTARTSYS;
gspca_dev->usb_err = 0;
if (gspca_dev->present)
ret = gspca_dev->sd_desc->set_streamparm(gspca_dev,
parm);
Expand Down Expand Up @@ -1689,6 +1701,7 @@ static int frame_wait(struct gspca_dev *gspca_dev,

if (gspca_dev->sd_desc->dq_callback) {
mutex_lock(&gspca_dev->usb_lock);
gspca_dev->usb_err = 0;
if (gspca_dev->present)
gspca_dev->sd_desc->dq_callback(gspca_dev);
mutex_unlock(&gspca_dev->usb_lock);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/video/gspca/gspca.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ struct gspca_dev {
struct mutex usb_lock; /* usb exchange protection */
struct mutex read_lock; /* read protection */
struct mutex queue_lock; /* ISOC queue protection */
int usb_err; /* USB error - protected by usb_lock */
#ifdef CONFIG_PM
char frozen; /* suspend - resume */
#endif
Expand Down

0 comments on commit 4a4c92c

Please sign in to comment.