Skip to content

Commit

Permalink
media/video: don't use flush_scheduled_work()
Browse files Browse the repository at this point in the history
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 <tj@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Tejun Heo committed Dec 24, 2010
1 parent 707bcf3 commit 8c71778
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
5 changes: 1 addition & 4 deletions drivers/media/video/bt8xx/bttv-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,13 @@ static void bttv_ir_start(struct bttv *btv, struct card_ir *ir)

static void bttv_ir_stop(struct bttv *btv)
{
if (btv->remote->polling) {
if (btv->remote->polling)
del_timer_sync(&btv->remote->timer);
flush_scheduled_work();
}

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

del_timer_sync(&btv->remote->timer_end);
flush_scheduled_work();

gpio = bttv_gpio_read(&btv->c);
bttv_gpio_write(&btv->c, gpio & ~(1 << 4));
Expand Down
2 changes: 0 additions & 2 deletions drivers/media/video/cx23885/cx23885-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ static void cx23885_input_ir_stop(struct cx23885_dev *dev)
v4l2_subdev_call(dev->sd_ir, ir, rx_s_parameters, &params);
v4l2_subdev_call(dev->sd_ir, ir, rx_g_parameters, &params);
}

flush_scheduled_work();
}

static void cx23885_input_ir_close(void *priv)
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/video/omap24xxcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)

atomic_inc(&cam->reset_disable);

flush_scheduled_work();
flush_work_sync(&cam->sensor_reset_work);

rval = videobuf_streamoff(q);
if (!rval) {
Expand Down Expand Up @@ -1512,7 +1512,7 @@ static int omap24xxcam_release(struct file *file)

atomic_inc(&cam->reset_disable);

flush_scheduled_work();
flush_work_sync(&cam->sensor_reset_work);

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

mutex_lock(&cam->mutex);
if (atomic_dec_return(&cam->users) == 0) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/saa7134/saa7134-empress.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ static int empress_fini(struct saa7134_dev *dev)

if (NULL == dev->empress_dev)
return 0;
flush_scheduled_work();
flush_work_sync(&dev->empress_workqueue);
video_unregister_device(dev->empress_dev);
dev->empress_dev = NULL;
return 0;
Expand Down

0 comments on commit 8c71778

Please sign in to comment.