diff options
author | Tejun Heo <tj@kernel.org> | 2010-12-24 10:14:20 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-12-24 10:14:20 -0500 |
commit | 8c71778cbf2c8beaefaa2dee5478aa0622d96682 (patch) | |
tree | 706fbdc96f696454d96538834b0d459967232e91 | |
parent | 707bcf326bd50c875d82bd2e7c31dcfb92b7e813 (diff) |
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 <tj@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/bt8xx/bttv-input.c | 5 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-input.c | 2 | ||||
-rw-r--r-- | drivers/media/video/omap24xxcam.c | 6 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-empress.c | 2 |
4 files changed, 5 insertions, 10 deletions
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c index 6bf05a7dc5f9..1989f002898b 100644 --- a/drivers/media/video/bt8xx/bttv-input.c +++ b/drivers/media/video/bt8xx/bttv-input.c | |||
@@ -229,16 +229,13 @@ static void bttv_ir_start(struct bttv *btv, struct card_ir *ir) | |||
229 | 229 | ||
230 | static void bttv_ir_stop(struct bttv *btv) | 230 | static void bttv_ir_stop(struct bttv *btv) |
231 | { | 231 | { |
232 | if (btv->remote->polling) { | 232 | if (btv->remote->polling) |
233 | del_timer_sync(&btv->remote->timer); | 233 | del_timer_sync(&btv->remote->timer); |
234 | flush_scheduled_work(); | ||
235 | } | ||
236 | 234 | ||
237 | if (btv->remote->rc5_gpio) { | 235 | if (btv->remote->rc5_gpio) { |
238 | u32 gpio; | 236 | u32 gpio; |
239 | 237 | ||
240 | del_timer_sync(&btv->remote->timer_end); | 238 | del_timer_sync(&btv->remote->timer_end); |
241 | flush_scheduled_work(); | ||
242 | 239 | ||
243 | gpio = bttv_gpio_read(&btv->c); | 240 | gpio = bttv_gpio_read(&btv->c); |
244 | bttv_gpio_write(&btv->c, gpio & ~(1 << 4)); | 241 | bttv_gpio_write(&btv->c, gpio & ~(1 << 4)); |
diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c index bb61870b8d6e..4a326fe0b01c 100644 --- a/drivers/media/video/cx23885/cx23885-input.c +++ b/drivers/media/video/cx23885/cx23885-input.c | |||
@@ -230,8 +230,6 @@ static void cx23885_input_ir_stop(struct cx23885_dev *dev) | |||
230 | v4l2_subdev_call(dev->sd_ir, ir, rx_s_parameters, ¶ms); | 230 | v4l2_subdev_call(dev->sd_ir, ir, rx_s_parameters, ¶ms); |
231 | v4l2_subdev_call(dev->sd_ir, ir, rx_g_parameters, ¶ms); | 231 | v4l2_subdev_call(dev->sd_ir, ir, rx_g_parameters, ¶ms); |
232 | } | 232 | } |
233 | |||
234 | flush_scheduled_work(); | ||
235 | } | 233 | } |
236 | 234 | ||
237 | static void cx23885_input_ir_close(void *priv) | 235 | static void cx23885_input_ir_close(void *priv) |
diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c index 378b094aff16..017552762902 100644 --- a/drivers/media/video/omap24xxcam.c +++ b/drivers/media/video/omap24xxcam.c | |||
@@ -1198,7 +1198,7 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i) | |||
1198 | 1198 | ||
1199 | atomic_inc(&cam->reset_disable); | 1199 | atomic_inc(&cam->reset_disable); |
1200 | 1200 | ||
1201 | flush_scheduled_work(); | 1201 | flush_work_sync(&cam->sensor_reset_work); |
1202 | 1202 | ||
1203 | rval = videobuf_streamoff(q); | 1203 | rval = videobuf_streamoff(q); |
1204 | if (!rval) { | 1204 | if (!rval) { |
@@ -1512,7 +1512,7 @@ static int omap24xxcam_release(struct file *file) | |||
1512 | 1512 | ||
1513 | atomic_inc(&cam->reset_disable); | 1513 | atomic_inc(&cam->reset_disable); |
1514 | 1514 | ||
1515 | flush_scheduled_work(); | 1515 | flush_work_sync(&cam->sensor_reset_work); |
1516 | 1516 | ||
1517 | /* stop streaming capture */ | 1517 | /* stop streaming capture */ |
1518 | videobuf_streamoff(&fh->vbq); | 1518 | videobuf_streamoff(&fh->vbq); |
@@ -1536,7 +1536,7 @@ static int omap24xxcam_release(struct file *file) | |||
1536 | * not be scheduled anymore since streaming is already | 1536 | * not be scheduled anymore since streaming is already |
1537 | * disabled.) | 1537 | * disabled.) |
1538 | */ | 1538 | */ |
1539 | flush_scheduled_work(); | 1539 | flush_work_sync(&cam->sensor_reset_work); |
1540 | 1540 | ||
1541 | mutex_lock(&cam->mutex); | 1541 | mutex_lock(&cam->mutex); |
1542 | if (atomic_dec_return(&cam->users) == 0) { | 1542 | if (atomic_dec_return(&cam->users) == 0) { |
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c index b890aafe7d64..6b8459c7728e 100644 --- a/drivers/media/video/saa7134/saa7134-empress.c +++ b/drivers/media/video/saa7134/saa7134-empress.c | |||
@@ -553,7 +553,7 @@ static int empress_fini(struct saa7134_dev *dev) | |||
553 | 553 | ||
554 | if (NULL == dev->empress_dev) | 554 | if (NULL == dev->empress_dev) |
555 | return 0; | 555 | return 0; |
556 | flush_scheduled_work(); | 556 | flush_work_sync(&dev->empress_workqueue); |
557 | video_unregister_device(dev->empress_dev); | 557 | video_unregister_device(dev->empress_dev); |
558 | dev->empress_dev = NULL; | 558 | dev->empress_dev = NULL; |
559 | return 0; | 559 | return 0; |