From patchwork Tue Jun 1 15:27:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 103569 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o51FS6sQ002588 for ; Tue, 1 Jun 2010 15:28:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756684Ab0FAP2F (ORCPT ); Tue, 1 Jun 2010 11:28:05 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:61533 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755601Ab0FAP2E (ORCPT ); Tue, 1 Jun 2010 11:28:04 -0400 Received: by fxm8 with SMTP id 8so1060808fxm.19 for ; Tue, 01 Jun 2010 08:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=R8DBrDVUac/r+LL03qe8yAkwoRyTsxbmOq5hHbJ1Uk8=; b=vCvFFc1or3NZyBmd8aYC8U1PCn8v+AoJHuxhkX+zxqGoqzWzLdRgKTefkfWWYkhMoW n1WvWebCDxdRvgt4iLrpR/DN+9N24Tre9P8S6TqY/h+YE8/Ia3f9EVxqHSLYdm4jKncY kRW6ldfJyMz01HFopB93rMFy7EvJi8LIhxDJk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=gq7onKOni2kLHu02iRFTrh60/X7UdE0NVXn4eh6pPuxlv+2A1hvJv5ypqK6bOCNS/y YFjNsesbdHMLDZ/XmTUY61R1AgtO1J+DvUARLsJwQNCbD2GSJSeEMXCrwh2B7A8eLNyl dBI95WEstz9EhrQNjqt+G0D8xKA7dAQlNQf3M= Received: by 10.223.45.83 with SMTP id d19mr7222389faf.65.1275406081785; Tue, 01 Jun 2010 08:28:01 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id y12sm47578322faj.17.2010.06.01.08.27.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 01 Jun 2010 08:28:01 -0700 (PDT) Date: Tue, 1 Jun 2010 17:27:45 +0200 From: Dan Carpenter To: Dmitry Torokhov Cc: Todd Fischer , Samuel Ortiz , linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] input/tps6507x-ts: a couple work queue cleanups Message-ID: <20100601152744.GN5483@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 01 Jun 2010 15:28:06 +0000 (UTC) diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c index 5de80a1..5b70a14 100644 --- a/drivers/input/touchscreen/tps6507x-ts.c +++ b/drivers/input/touchscreen/tps6507x-ts.c @@ -221,7 +221,7 @@ done: if (poll) { schd = queue_delayed_work(tsc->wq, &tsc->work, - tsc->poll_period * HZ / 1000); + msecs_to_jiffies(tsc->poll_period)); if (schd) tsc->polling = 1; else { @@ -326,7 +326,7 @@ static int tps6507x_ts_probe(struct platform_device *pdev) goto err2; schd = queue_delayed_work(tsc->wq, &tsc->work, - tsc->poll_period * HZ / 1000); + msecs_to_jiffies(tsc->poll_period)); if (schd) tsc->polling = 1; @@ -339,10 +339,8 @@ static int tps6507x_ts_probe(struct platform_device *pdev) return 0; err2: - cancel_delayed_work(&tsc->work); - flush_workqueue(tsc->wq); + cancel_delayed_work_sync(&tsc->work); destroy_workqueue(tsc->wq); - tsc->wq = 0; input_free_device(input_dev); err1: kfree(tsc); @@ -360,10 +358,8 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev) if (!tsc) return 0; - cancel_delayed_work(&tsc->work); - flush_workqueue(tsc->wq); + cancel_delayed_work_sync(&tsc->work); destroy_workqueue(tsc->wq); - tsc->wq = 0; input_free_device(input_dev);