Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330959
b: refs/heads/master
c: 345321d
h: refs/heads/master
i:
  330957: fb2f880
  330955: 907a6df
  330951: f271fb0
  330943: 0ef200a
v: v3
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Sep 13, 2012
1 parent 602c6a8 commit b86c798
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c96f0a207bedb6f06089fde9adc7abe8136a087
refs/heads/master: 345321dc9c52b774f42c934339f9b3e2f0a39395
6 changes: 3 additions & 3 deletions trunk/drivers/media/usb/gspca/finepix.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static void dostream(struct work_struct *work)

/* loop reading a frame */
again:
while (gspca_dev->dev && gspca_dev->streaming) {
while (gspca_dev->present && gspca_dev->streaming) {
#ifdef CONFIG_PM
if (gspca_dev->frozen)
break;
Expand All @@ -110,7 +110,7 @@ static void dostream(struct work_struct *work)
if (gspca_dev->frozen)
break;
#endif
if (!gspca_dev->dev || !gspca_dev->streaming)
if (!gspca_dev->present || !gspca_dev->streaming)
break;

/* the frame comes in parts */
Expand All @@ -129,7 +129,7 @@ static void dostream(struct work_struct *work)
if (gspca_dev->frozen)
goto out;
#endif
if (!gspca_dev->dev || !gspca_dev->streaming)
if (!gspca_dev->present || !gspca_dev->streaming)
goto out;
if (len < FPIX_MAX_TRANSFER ||
(data[len - 2] == 0xff &&
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/usb/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -2358,8 +2358,6 @@ void gspca_disconnect(struct usb_interface *intf)

mutex_lock(&gspca_dev->usb_lock);

usb_set_intfdata(intf, NULL);
gspca_dev->dev = NULL;
gspca_dev->present = 0;
destroy_urbs(gspca_dev);

Expand All @@ -2375,6 +2373,7 @@ void gspca_disconnect(struct usb_interface *intf)
if (gspca_dev->sd_desc->stop0 && gspca_dev->streaming)
gspca_dev->sd_desc->stop0(gspca_dev);
gspca_dev->streaming = 0;
gspca_dev->dev = NULL;
wake_up_interruptible(&gspca_dev->wq);

v4l2_device_disconnect(&gspca_dev->v4l2_dev);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/media/usb/gspca/jl2005bcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ static void jl2005c_dostream(struct work_struct *work)
goto quit_stream;
}

while (gspca_dev->dev && gspca_dev->streaming) {
while (gspca_dev->present && gspca_dev->streaming) {
#ifdef CONFIG_PM
if (gspca_dev->frozen)
break;
Expand Down Expand Up @@ -371,7 +371,7 @@ static void jl2005c_dostream(struct work_struct *work)
buffer, act_len);
header_read = 1;
}
while (bytes_left > 0 && gspca_dev->dev) {
while (bytes_left > 0 && gspca_dev->present) {
data_len = bytes_left > JL2005C_MAX_TRANSFER ?
JL2005C_MAX_TRANSFER : bytes_left;
ret = usb_bulk_msg(gspca_dev->dev,
Expand All @@ -394,7 +394,7 @@ static void jl2005c_dostream(struct work_struct *work)
}
}
quit_stream:
if (gspca_dev->dev) {
if (gspca_dev->present) {
mutex_lock(&gspca_dev->usb_lock);
jl2005c_stop(gspca_dev);
mutex_unlock(&gspca_dev->usb_lock);
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/media/usb/gspca/sq905.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static void sq905_dostream(struct work_struct *work)
frame_sz = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].sizeimage
+ FRAME_HEADER_LEN;

while (gspca_dev->dev && gspca_dev->streaming) {
while (gspca_dev->present && gspca_dev->streaming) {
#ifdef CONFIG_PM
if (gspca_dev->frozen)
break;
Expand All @@ -246,7 +246,7 @@ static void sq905_dostream(struct work_struct *work)
we must finish reading an entire frame, otherwise the
next time we stream we start reading in the middle of a
frame. */
while (bytes_left > 0 && gspca_dev->dev) {
while (bytes_left > 0 && gspca_dev->present) {
data_len = bytes_left > SQ905_MAX_TRANSFER ?
SQ905_MAX_TRANSFER : bytes_left;
ret = sq905_read_data(gspca_dev, buffer, data_len, 1);
Expand Down Expand Up @@ -278,7 +278,7 @@ static void sq905_dostream(struct work_struct *work)
gspca_frame_add(gspca_dev, LAST_PACKET,
NULL, 0);
}
if (gspca_dev->dev) {
if (gspca_dev->present) {
/* acknowledge the frame */
mutex_lock(&gspca_dev->usb_lock);
ret = sq905_ack_frame(gspca_dev);
Expand All @@ -288,7 +288,7 @@ static void sq905_dostream(struct work_struct *work)
}
}
quit_stream:
if (gspca_dev->dev) {
if (gspca_dev->present) {
mutex_lock(&gspca_dev->usb_lock);
sq905_command(gspca_dev, SQ905_CLEAR);
mutex_unlock(&gspca_dev->usb_lock);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/media/usb/gspca/sq905c.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static void sq905c_dostream(struct work_struct *work)
goto quit_stream;
}

while (gspca_dev->dev && gspca_dev->streaming) {
while (gspca_dev->present && gspca_dev->streaming) {
#ifdef CONFIG_PM
if (gspca_dev->frozen)
break;
Expand All @@ -173,7 +173,7 @@ static void sq905c_dostream(struct work_struct *work)
packet_type = FIRST_PACKET;
gspca_frame_add(gspca_dev, packet_type,
buffer, FRAME_HEADER_LEN);
while (bytes_left > 0 && gspca_dev->dev) {
while (bytes_left > 0 && gspca_dev->present) {
data_len = bytes_left > SQ905C_MAX_TRANSFER ?
SQ905C_MAX_TRANSFER : bytes_left;
ret = usb_bulk_msg(gspca_dev->dev,
Expand All @@ -195,7 +195,7 @@ static void sq905c_dostream(struct work_struct *work)
}
}
quit_stream:
if (gspca_dev->dev) {
if (gspca_dev->present) {
mutex_lock(&gspca_dev->usb_lock);
sq905c_command(gspca_dev, SQ905C_CLEAR, 0);
mutex_unlock(&gspca_dev->usb_lock);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/usb/gspca/vicam.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static void vicam_dostream(struct work_struct *work)
goto exit;
}

while (gspca_dev->dev && gspca_dev->streaming) {
while (gspca_dev->present && gspca_dev->streaming) {
#ifdef CONFIG_PM
if (gspca_dev->frozen)
break;
Expand Down Expand Up @@ -299,7 +299,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
dev->work_thread = NULL;
mutex_lock(&gspca_dev->usb_lock);

if (gspca_dev->dev)
if (gspca_dev->present)
vicam_set_camera_power(gspca_dev, 0);
}

Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/media/usb/gspca/xirlink_cit.c
Original file line number Diff line number Diff line change
Expand Up @@ -2697,9 +2697,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;

/* We cannot use gspca_dev->present here as that is not set when
sd_init gets called and we get called from sd_init */
if (!gspca_dev->dev)
if (!gspca_dev->present)
return;

switch (sd->model) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/usb/gspca/zc3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -5950,7 +5950,7 @@ static void transfer_update(struct work_struct *work)
if (gspca_dev->frozen)
goto err;
#endif
if (!gspca_dev->dev || !gspca_dev->streaming)
if (!gspca_dev->present || !gspca_dev->streaming)
goto err;

/* Bit 0 of register 11 indicates FIFO overflow */
Expand Down Expand Up @@ -6842,7 +6842,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
mutex_lock(&gspca_dev->usb_lock);
sd->work_thread = NULL;
}
if (!gspca_dev->dev)
if (!gspca_dev->present)
return;
send_unknown(gspca_dev, sd->sensor);
}
Expand Down

0 comments on commit b86c798

Please sign in to comment.