From patchwork Sat Dec 22 01:57:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 1905171 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A3CDC3FE37 for ; Sat, 22 Dec 2012 02:01:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752318Ab2LVCBA (ORCPT ); Fri, 21 Dec 2012 21:01:00 -0500 Received: from mail-ie0-f174.google.com ([209.85.223.174]:48614 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752567Ab2LVB6b (ORCPT ); Fri, 21 Dec 2012 20:58:31 -0500 Received: by mail-ie0-f174.google.com with SMTP id c11so6966457ieb.5 for ; Fri, 21 Dec 2012 17:58:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=pEtw7VAfvltXPnb1eGvcm3PW8OfRyXeuDGZNApu1U/8=; b=w+xhbTKPebEuQx7oHtpD/1ffAJiP+EtRcFgsYLiFgsjfE4Ou/L5kGE/UxjuHLWbZlu GuLVzbyioBdk6D+gL9wmT6iEdU1uLXC/jczb3zJKR7pXIs5VlG7w7OHJhC9OdThzMCur 8Z0AQbHH+VPWMgVp6zX83djIrb0UXVQ0opdbctBKMMm/rUQVAnYx7pGqHBJnKEQV21vm CH+c3uTDS3AHNi6W1iFK/4RSyjIWl0OTgZO/ycQku4DimXFgHWRqsJW0rsPk2p4htEVq IefDyo5ru1mONkKzLKSosU//5hhKD73WmI7YF+Y8AaKJgsadbU/m3DU4La7DXMVl6a4o WTiQ== X-Received: by 10.43.70.7 with SMTP id ye7mr13440881icb.9.1356141511108; Fri, 21 Dec 2012 17:58:31 -0800 (PST) Received: from htj.dyndns.org.com (c-69-181-251-227.hsd1.ca.comcast.net. [69.181.251.227]) by mx.google.com with ESMTPS id v12sm10975374igv.3.2012.12.21.17.58.28 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2012 17:58:30 -0800 (PST) From: Tejun Heo To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Mark Brown , Liam Girdwood , linux-input@vger.kernel.org, Dmitry Torokhov Subject: [PATCH 17/25] wm97xx: don't use [delayed_]work_pending() Date: Fri, 21 Dec 2012 17:57:07 -0800 Message-Id: <1356141435-17340-18-git-send-email-tj@kernel.org> X-Mailer: git-send-email 1.8.0.2 In-Reply-To: <1356141435-17340-1-git-send-email-tj@kernel.org> References: <1356141435-17340-1-git-send-email-tj@kernel.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.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 Cc: Mark Brown Cc: Liam Girdwood Cc: linux-input@vger.kernel.org Cc: Dmitry Torokhov --- 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; }