diff --git a/drivers/media/video/gspca/finepix.c b/drivers/media/video/gspca/finepix.c index d0befe981098a7ecf8f868fb61d3fbfcb157e11e..6e26c93b4656934aa3c3de03f29766f77db7ca4c 100644 --- a/drivers/media/video/gspca/finepix.c +++ b/drivers/media/video/gspca/finepix.c @@ -94,7 +94,11 @@ static void dostream(struct work_struct *work) /* loop reading a frame */ again: - while (!gspca_dev->frozen && gspca_dev->dev && gspca_dev->streaming) { + while (gspca_dev->dev && gspca_dev->streaming) { +#ifdef CONFIG_PM + if (gspca_dev->frozen) + break; +#endif /* request a frame */ mutex_lock(&gspca_dev->usb_lock); @@ -102,8 +106,11 @@ static void dostream(struct work_struct *work) mutex_unlock(&gspca_dev->usb_lock); if (ret < 0) break; - if (gspca_dev->frozen || !gspca_dev->dev || - !gspca_dev->streaming) +#ifdef CONFIG_PM + if (gspca_dev->frozen) + break; +#endif + if (!gspca_dev->dev || !gspca_dev->streaming) break; /* the frame comes in parts */ @@ -118,8 +125,11 @@ static void dostream(struct work_struct *work) * error. Just restart. */ goto again; } - if (gspca_dev->frozen || !gspca_dev->dev || - !gspca_dev->streaming) +#ifdef CONFIG_PM + if (gspca_dev->frozen) + goto out; +#endif + if (!gspca_dev->dev || !gspca_dev->streaming) goto out; if (len < FPIX_MAX_TRANSFER || (data[len - 2] == 0xff && diff --git a/drivers/media/video/gspca/jl2005bcd.c b/drivers/media/video/gspca/jl2005bcd.c index e1fc2561e4bc9f6b3549f5d804910f3a20ca74d7..9c591c7c6f545b02a49b14c7b231045f29e0d531 100644 --- a/drivers/media/video/gspca/jl2005bcd.c +++ b/drivers/media/video/gspca/jl2005bcd.c @@ -335,7 +335,11 @@ static void jl2005c_dostream(struct work_struct *work) goto quit_stream; } - while (!gspca_dev->frozen && gspca_dev->dev && gspca_dev->streaming) { + while (gspca_dev->dev && gspca_dev->streaming) { +#ifdef CONFIG_PM + if (gspca_dev->frozen) + break; +#endif /* Check if this is a new frame. If so, start the frame first */ if (!header_read) { mutex_lock(&gspca_dev->usb_lock); diff --git a/drivers/media/video/gspca/sq905.c b/drivers/media/video/gspca/sq905.c index a144ce759b662b4cf0bf4d5c1f0b99e59a22693b..04f54654a0264743162a56c95dc0e2c910ab942d 100644 --- a/drivers/media/video/gspca/sq905.c +++ b/drivers/media/video/gspca/sq905.c @@ -232,7 +232,11 @@ 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->frozen && gspca_dev->dev && gspca_dev->streaming) { + while (gspca_dev->dev && gspca_dev->streaming) { +#ifdef CONFIG_PM + if (gspca_dev->frozen) + break; +#endif /* request some data and then read it until we have * a complete frame. */ bytes_left = frame_sz; diff --git a/drivers/media/video/gspca/sq905c.c b/drivers/media/video/gspca/sq905c.c index 720c187f6ec7af799fc9fd80b2bf99728cfd161c..f34ddb0570c86a7f41242fc6d4082d3e07890890 100644 --- a/drivers/media/video/gspca/sq905c.c +++ b/drivers/media/video/gspca/sq905c.c @@ -150,7 +150,11 @@ static void sq905c_dostream(struct work_struct *work) goto quit_stream; } - while (!gspca_dev->frozen && gspca_dev->dev && gspca_dev->streaming) { + while (gspca_dev->dev && gspca_dev->streaming) { +#ifdef CONFIG_PM + if (gspca_dev->frozen) + break; +#endif /* Request the header, which tells the size to download */ ret = usb_bulk_msg(gspca_dev->dev, usb_rcvbulkpipe(gspca_dev->dev, 0x81), diff --git a/drivers/media/video/gspca/vicam.c b/drivers/media/video/gspca/vicam.c index 432d6cd99cd65915ea8f218bf77b4e08a3f37510..15a30f7a4b2ab73593da9d28988effee6f165287 100644 --- a/drivers/media/video/gspca/vicam.c +++ b/drivers/media/video/gspca/vicam.c @@ -225,7 +225,11 @@ static void vicam_dostream(struct work_struct *work) goto exit; } - while (!gspca_dev->frozen && gspca_dev->dev && gspca_dev->streaming) { + while (gspca_dev->dev && gspca_dev->streaming) { +#ifdef CONFIG_PM + if (gspca_dev->frozen) + break; +#endif ret = vicam_read_frame(gspca_dev, buffer, frame_sz); if (ret < 0) break; diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c index 0d504a7c512c7a4ca600c8c12ac7cc217b539ec3..f0bacee33ef9a4e22c7876030c026468336df1d8 100644 --- a/drivers/media/video/gspca/zc3xx.c +++ b/drivers/media/video/gspca/zc3xx.c @@ -5946,8 +5946,11 @@ static void transfer_update(struct work_struct *work) msleep(100); mutex_lock(&gspca_dev->usb_lock); - if (gspca_dev->frozen || !gspca_dev->dev || - !gspca_dev->streaming) +#ifdef CONFIG_PM + if (gspca_dev->frozen) + goto err; +#endif + if (!gspca_dev->dev || !gspca_dev->streaming) goto err; /* Bit 0 of register 11 indicates FIFO overflow */