aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/gspca/gspca.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index b7cb9977f778..38b124ec23a3 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -595,6 +595,7 @@ static int gspca_set_alt0(struct gspca_dev *gspca_dev)
595static void gspca_stream_off(struct gspca_dev *gspca_dev) 595static void gspca_stream_off(struct gspca_dev *gspca_dev)
596{ 596{
597 gspca_dev->streaming = 0; 597 gspca_dev->streaming = 0;
598 gspca_dev->usb_err = 0;
598 if (gspca_dev->sd_desc->stopN) 599 if (gspca_dev->sd_desc->stopN)
599 gspca_dev->sd_desc->stopN(gspca_dev); 600 gspca_dev->sd_desc->stopN(gspca_dev);
600 destroy_urbs(gspca_dev); 601 destroy_urbs(gspca_dev);
@@ -1331,10 +1332,8 @@ static int dev_close(struct file *file)
1331 1332
1332 /* if the file did the capture, free the streaming resources */ 1333 /* if the file did the capture, free the streaming resources */
1333 if (gspca_dev->capt_file == file) { 1334 if (gspca_dev->capt_file == file) {
1334 if (gspca_dev->streaming) { 1335 if (gspca_dev->streaming)
1335 gspca_dev->usb_err = 0;
1336 gspca_stream_off(gspca_dev); 1336 gspca_stream_off(gspca_dev);
1337 }
1338 frame_free(gspca_dev); 1337 frame_free(gspca_dev);
1339 } 1338 }
1340 module_put(gspca_dev->module); 1339 module_put(gspca_dev->module);
@@ -1569,7 +1568,6 @@ static int vidioc_reqbufs(struct file *file, void *priv,
1569 /* stop streaming */ 1568 /* stop streaming */
1570 streaming = gspca_dev->streaming; 1569 streaming = gspca_dev->streaming;
1571 if (streaming) { 1570 if (streaming) {
1572 gspca_dev->usb_err = 0;
1573 gspca_stream_off(gspca_dev); 1571 gspca_stream_off(gspca_dev);
1574 1572
1575 /* Don't restart the stream when switching from read 1573 /* Don't restart the stream when switching from read
@@ -1675,7 +1673,6 @@ static int vidioc_streamoff(struct file *file, void *priv,
1675 } 1673 }
1676 1674
1677 /* stop streaming */ 1675 /* stop streaming */
1678 gspca_dev->usb_err = 0;
1679 gspca_stream_off(gspca_dev); 1676 gspca_stream_off(gspca_dev);
1680 /* In case another thread is waiting in dqbuf */ 1677 /* In case another thread is waiting in dqbuf */
1681 wake_up_interruptible(&gspca_dev->wq); 1678 wake_up_interruptible(&gspca_dev->wq);