From: Tejun Heo <tj@kernel.org>
To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Cc: Tejun Heo <tj@kernel.org>, Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: [PATCH 4/6] media/video: don't use flush_scheduled_work()
Date: Sun, 12 Dec 2010 17:48:17 +0100 [thread overview]
Message-ID: <1292172499-21633-5-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1292172499-21633-1-git-send-email-tj@kernel.org>
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>
---
This is part of a series to remove flush_scheduled_work() usage to
prepare for deprecation of flush_scheduled_work(). Patches in this
series are self contained and mostly straight-forward.
Please feel free to take it into the appropriate tree, or just ack it.
In the latter case, I'll merge the patch through the workqueue tree
during the next merge window.
Thank you.
drivers/media/video/bt8xx/bttv-input.c | 5 +----
drivers/media/video/cx23885/cx23885-input.c | 2 --
drivers/media/video/omap24xxcam.c | 6 +++---
drivers/media/video/saa7134/saa7134-empress.c | 2 +-
drivers/video/fb_defio.c | 5 ++---
5 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c
index 6bf05a7..1989f00 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)
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));
diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c
index bb61870..4a326fe 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)
v4l2_subdev_call(dev->sd_ir, ir, rx_s_parameters, ¶ms);
v4l2_subdev_call(dev->sd_ir, ir, rx_g_parameters, ¶ms);
}
-
- flush_scheduled_work();
}
static void cx23885_input_ir_close(void *priv)
diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c
index 378b094..0175527 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)
atomic_inc(&cam->reset_disable);
- flush_scheduled_work();
+ flush_work_sync(&cam->sensor_reset_work);
rval = videobuf_streamoff(q);
if (!rval) {
@@ -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);
@@ -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) {
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index b890aaf..6b8459c 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)
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;
diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c
index 6b93ef9..a79c0de 100644
--- a/drivers/video/fb_defio.c
+++ b/drivers/video/fb_defio.c
@@ -75,7 +75,7 @@ int fb_deferred_io_fsync(struct file *file, int datasync)
return 0;
/* Kill off the delayed work */
- cancel_rearming_delayed_work(&info->deferred_work);
+ cancel_delayed_work_sync(&info->deferred_work);
/* Run it immediately */
return schedule_delayed_work(&info->deferred_work, 0);
@@ -216,8 +216,7 @@ void fb_deferred_io_cleanup(struct fb_info *info)
int i;
BUG_ON(!fbdefio);
- cancel_delayed_work(&info->deferred_work);
- flush_scheduled_work();
+ cancel_delayed_work_sync(&info->deferred_work);
/* clear out the mapping that we setup */
for (i = 0 ; i < info->fix.smem_len; i += PAGE_SIZE) {
--
1.7.1
next prev parent reply other threads:[~2010-12-12 16:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-12 16:48 [PATCHSET] workqueue: another assorted flush_scheduled_work() removals Tejun Heo
2010-12-12 16:48 ` [PATCH 1/6] init: don't call flush_scheduled_work() from do_initcalls() Tejun Heo
2010-12-12 16:48 ` [PATCH 2/6] ioc4: use static work_struct for ioc4_load_modules() Tejun Heo
2010-12-12 16:48 ` [PATCH 3/6] media/video: explicitly flush request_module work Tejun Heo
2010-12-12 16:48 ` Tejun Heo [this message]
2010-12-12 16:48 ` [PATCH 5/6] speedtch: don't abuse struct delayed_work Tejun Heo
2010-12-16 21:30 ` Greg KH
2010-12-17 11:05 ` Tejun Heo
2010-12-12 16:48 ` [PATCH 6/6] usb: don't use flush_scheduled_work() Tejun Heo
2010-12-17 13:51 ` speedtch: don't abuse struct delayed_work Nicolas Kaiser
2010-12-18 11:58 ` Nicolas Kaiser
2010-12-18 16:32 ` [PATCH UPDATED 5/6] " Tejun Heo
2010-12-18 17:59 ` Nicolas Kaiser
2010-12-24 15:14 ` [PATCHSET] workqueue: another assorted flush_scheduled_work() removals Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1292172499-21633-5-git-send-email-tj@kernel.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.