Commit a3cc74d4 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

[media] gspca: Set gspca_dev->usb_err to 0 at the begin of gspca_stream_off

Just a small cleanup.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent eb238732
...@@ -595,6 +595,7 @@ static int gspca_set_alt0(struct gspca_dev *gspca_dev) ...@@ -595,6 +595,7 @@ static int gspca_set_alt0(struct gspca_dev *gspca_dev)
static void gspca_stream_off(struct gspca_dev *gspca_dev) static void gspca_stream_off(struct gspca_dev *gspca_dev)
{ {
gspca_dev->streaming = 0; gspca_dev->streaming = 0;
gspca_dev->usb_err = 0;
if (gspca_dev->sd_desc->stopN) if (gspca_dev->sd_desc->stopN)
gspca_dev->sd_desc->stopN(gspca_dev); gspca_dev->sd_desc->stopN(gspca_dev);
destroy_urbs(gspca_dev); destroy_urbs(gspca_dev);
...@@ -1331,10 +1332,8 @@ static int dev_close(struct file *file) ...@@ -1331,10 +1332,8 @@ static int dev_close(struct file *file)
/* if the file did the capture, free the streaming resources */ /* if the file did the capture, free the streaming resources */
if (gspca_dev->capt_file == file) { if (gspca_dev->capt_file == file) {
if (gspca_dev->streaming) { if (gspca_dev->streaming)
gspca_dev->usb_err = 0;
gspca_stream_off(gspca_dev); gspca_stream_off(gspca_dev);
}
frame_free(gspca_dev); frame_free(gspca_dev);
} }
module_put(gspca_dev->module); module_put(gspca_dev->module);
...@@ -1569,7 +1568,6 @@ static int vidioc_reqbufs(struct file *file, void *priv, ...@@ -1569,7 +1568,6 @@ static int vidioc_reqbufs(struct file *file, void *priv,
/* stop streaming */ /* stop streaming */
streaming = gspca_dev->streaming; streaming = gspca_dev->streaming;
if (streaming) { if (streaming) {
gspca_dev->usb_err = 0;
gspca_stream_off(gspca_dev); gspca_stream_off(gspca_dev);
/* Don't restart the stream when switching from read /* Don't restart the stream when switching from read
...@@ -1675,7 +1673,6 @@ static int vidioc_streamoff(struct file *file, void *priv, ...@@ -1675,7 +1673,6 @@ static int vidioc_streamoff(struct file *file, void *priv,
} }
/* stop streaming */ /* stop streaming */
gspca_dev->usb_err = 0;
gspca_stream_off(gspca_dev); gspca_stream_off(gspca_dev);
/* In case another thread is waiting in dqbuf */ /* In case another thread is waiting in dqbuf */
wake_up_interruptible(&gspca_dev->wq); wake_up_interruptible(&gspca_dev->wq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment