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: 3082651 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0807D9F372 for ; Tue, 22 Oct 2013 12:57:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6BE8F2041B for ; Tue, 22 Oct 2013 12:57:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 49AD820258 for ; Tue, 22 Oct 2013 12:57:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754197Ab3JVM5h (ORCPT ); Tue, 22 Oct 2013 08:57:37 -0400 Received: from ring0.de ([91.143.88.219]:36082 "EHLO smtp.ring0.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752823Ab3JVMzL (ORCPT ); Tue, 22 Oct 2013 08:55:11 -0400 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=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Cc: =?UTF-8?q?=27Beno=C3=AEt=20Cousson=27?= , Tony Lindgren , Rob Herring , Pawel Moll , Mark Rutland , Stephen Warren , Ian Campbell , Rob Landley , Russell King , Dmitry Torokhov , Grant Likely , devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, Sebastian Reichel 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> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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;