From patchwork Tue Oct 22 12:55:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 3082601 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EF03EBF925 for ; Tue, 22 Oct 2013 12:57:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFD1C20439 for ; Tue, 22 Oct 2013 12:57:25 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97C5D20448 for ; Tue, 22 Oct 2013 12:57:24 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYbVb-0002kP-8S; Tue, 22 Oct 2013 12:56:27 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYbVJ-0002Bx-Dt; Tue, 22 Oct 2013 12:56:09 +0000 Received: from [2a02:180:1:1::551f:bb62] (helo=smtp.ring0.de) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYbUf-00024n-7s for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2013 12:55:32 +0000 Received: from comu.ring0.de (unknown [127.0.0.1]) by smtp.ring0.de (Postfix) with ESMTP id 2F2302C58F3E; Tue, 22 Oct 2013 14:55:10 +0200 (CEST) Received: (from spamd@localhost) by comu.ring0.de (8.13.8/8.13.8/Submit) id r9MCt9Dp020224; Tue, 22 Oct 2013 14:55:09 +0200 X-Authentication-Warning: comu.ring0.de: spamd set sender to sre@ring0.de using -f X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from sre.ring0.de (unknown [134.106.93.31]) by smtp.ring0.de (Postfix) with ESMTP id 72F6A2C58F28; Tue, 22 Oct 2013 14:55:08 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel , linux-input@vger.kernel.org Subject: [PATCH 3/4] Input: twl4030-pwrbutton: simplify driver using devm_* Date: Tue, 22 Oct 2013 14:55:03 +0200 Message-Id: <1382446504-27837-4-git-send-email-sre@debian.org> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1382446504-27837-1-git-send-email-sre@debian.org> References: <1382446504-27837-1-git-send-email-sre@debian.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131022_085529_523556_2694D46D X-CRM114-Status: GOOD ( 10.02 ) X-Spam-Score: -1.1 (-) Cc: Mark Rutland , devicetree@vger.kernel.org, Dmitry Torokhov , Russell King , Rob Landley , Pawel Moll , Stephen Warren , Tony Lindgren , Sebastian Reichel , Ian Campbell , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , =?UTF-8?q?=27Beno=C3=AEt=20Cousson=27?= , Grant Likely , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use managed irq resource to simplify the driver. Signed-off-by: Sebastian Reichel --- drivers/input/misc/twl4030-pwrbutton.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/misc/twl4030-pwrbutton.c b/drivers/input/misc/twl4030-pwrbutton.c index 4e7a810..4ab9243 100644 --- a/drivers/input/misc/twl4030-pwrbutton.c +++ b/drivers/input/misc/twl4030-pwrbutton.c @@ -70,7 +70,7 @@ static int twl4030_pwrbutton_probe(struct platform_device *pdev) pwr->phys = "twl4030_pwrbutton/input0"; pwr->dev.parent = &pdev->dev; - err = request_threaded_irq(irq, NULL, powerbutton_irq, + err = devm_request_threaded_irq(&pwr->dev, irq, NULL, powerbutton_irq, IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, "twl4030_pwrbutton", pwr); if (err < 0) { @@ -81,15 +81,13 @@ static int twl4030_pwrbutton_probe(struct platform_device *pdev) err = input_register_device(pwr); if (err) { dev_err(&pdev->dev, "Can't register power button: %d\n", err); - goto free_irq; + goto free_input_dev; } platform_set_drvdata(pdev, pwr); return 0; -free_irq: - free_irq(irq, pwr); free_input_dev: input_free_device(pwr); return err; @@ -98,9 +96,7 @@ free_input_dev: static int __exit twl4030_pwrbutton_remove(struct platform_device *pdev) { struct input_dev *pwr = platform_get_drvdata(pdev); - int irq = platform_get_irq(pdev, 0); - free_irq(irq, pwr); input_unregister_device(pwr); return 0;