From: Tejun Heo <tj@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@slimlogic.co.uk>,
linux-input@vger.kernel.org,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: [PATCH 17/25] wm97xx: don't use [delayed_]work_pending()
Date: Fri, 21 Dec 2012 17:57:07 -0800 [thread overview]
Message-ID: <1356141435-17340-18-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1356141435-17340-1-git-send-email-tj@kernel.org>
There's no need to test whether a (delayed) work item in pending
before queueing, flushing or cancelling it. Most uses are unnecessary
and quite a few of them are buggy.
Remove unnecessary pending tests from wm97xx. Instead of testing
work_pending(), use the return value of queue_work() to decide whether
to disable IRQ or not.
Only compile tested.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
Please let me know how this patch should be routed. I can take it
through the workqueue tree if necessary.
Thanks.
drivers/input/touchscreen/wm97xx-core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index 5dbe73a..fd16c63 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -363,10 +363,8 @@ static irqreturn_t wm97xx_pen_interrupt(int irq, void *dev_id)
{
struct wm97xx *wm = dev_id;
- if (!work_pending(&wm->pen_event_work)) {
+ if (queue_work(wm->ts_workq, &wm->pen_event_work))
wm->mach_ops->irq_enable(wm, 0);
- queue_work(wm->ts_workq, &wm->pen_event_work);
- }
return IRQ_HANDLED;
}
--
1.8.0.2
next parent reply other threads:[~2012-12-22 1:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1356141435-17340-1-git-send-email-tj@kernel.org>
2012-12-22 1:57 ` Tejun Heo [this message]
2012-12-23 9:54 ` [PATCH 17/25] wm97xx: don't use [delayed_]work_pending() Dmitry Torokhov
2012-12-24 16:18 ` Mark Brown
2013-03-09 23:53 ` Dmitry Torokhov
2013-03-12 18:49 ` Mark Brown
2012-12-24 18:25 ` 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=1356141435-17340-18-git-send-email-tj@kernel.org \
--to=tj@kernel.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).