Skip to content

Commit 8c71778

Browse files
committed
media/video: don't use flush_scheduled_work()
This patch converts the remaining users of flush_scheduled_work() in media/video. * bttv-input.c and cx23885-input.c don't use workqueue at all. No need to flush. * Make omap24xxcam.c and saa7134-empress.c flush the used work directly. * In fd_defio.c, replace cancel_delayed_work() + flush_scheduled_work() with cancel_delayed_work_sync(). While at it, replace the deprecated cancel_rearming_delayed_work() with cancel_delayed_work_sync(). Signed-off-by: Tejun Heo <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]>
1 parent 707bcf3 commit 8c71778

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

drivers/media/video/bt8xx/bttv-input.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,16 +229,13 @@ static void bttv_ir_start(struct bttv *btv, struct card_ir *ir)
229229

230230
static void bttv_ir_stop(struct bttv *btv)
231231
{
232-
if (btv->remote->polling) {
232+
if (btv->remote->polling)
233233
del_timer_sync(&btv->remote->timer);
234-
flush_scheduled_work();
235-
}
236234

237235
if (btv->remote->rc5_gpio) {
238236
u32 gpio;
239237

240238
del_timer_sync(&btv->remote->timer_end);
241-
flush_scheduled_work();
242239

243240
gpio = bttv_gpio_read(&btv->c);
244241
bttv_gpio_write(&btv->c, gpio & ~(1 << 4));

drivers/media/video/cx23885/cx23885-input.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,6 @@ static void cx23885_input_ir_stop(struct cx23885_dev *dev)
230230
v4l2_subdev_call(dev->sd_ir, ir, rx_s_parameters, &params);
231231
v4l2_subdev_call(dev->sd_ir, ir, rx_g_parameters, &params);
232232
}
233-
234-
flush_scheduled_work();
235233
}
236234

237235
static void cx23885_input_ir_close(void *priv)

drivers/media/video/omap24xxcam.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)
11981198

11991199
atomic_inc(&cam->reset_disable);
12001200

1201-
flush_scheduled_work();
1201+
flush_work_sync(&cam->sensor_reset_work);
12021202

12031203
rval = videobuf_streamoff(q);
12041204
if (!rval) {
@@ -1512,7 +1512,7 @@ static int omap24xxcam_release(struct file *file)
15121512

15131513
atomic_inc(&cam->reset_disable);
15141514

1515-
flush_scheduled_work();
1515+
flush_work_sync(&cam->sensor_reset_work);
15161516

15171517
/* stop streaming capture */
15181518
videobuf_streamoff(&fh->vbq);
@@ -1536,7 +1536,7 @@ static int omap24xxcam_release(struct file *file)
15361536
* not be scheduled anymore since streaming is already
15371537
* disabled.)
15381538
*/
1539-
flush_scheduled_work();
1539+
flush_work_sync(&cam->sensor_reset_work);
15401540

15411541
mutex_lock(&cam->mutex);
15421542
if (atomic_dec_return(&cam->users) == 0) {

drivers/media/video/saa7134/saa7134-empress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ static int empress_fini(struct saa7134_dev *dev)
553553

554554
if (NULL == dev->empress_dev)
555555
return 0;
556-
flush_scheduled_work();
556+
flush_work_sync(&dev->empress_workqueue);
557557
video_unregister_device(dev->empress_dev);
558558
dev->empress_dev = NULL;
559559
return 0;

0 commit comments

Comments
 (0)