From patchwork Wed Jan 18 17:46:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9524411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2832760113 for ; Wed, 18 Jan 2017 17:49:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1955E26E8A for ; Wed, 18 Jan 2017 17:49:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E2452860E; Wed, 18 Jan 2017 17:49:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3BDA26E8A for ; Wed, 18 Jan 2017 17:49:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752657AbdARRtG (ORCPT ); Wed, 18 Jan 2017 12:49:06 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:59124 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753402AbdARRtB (ORCPT ); Wed, 18 Jan 2017 12:49:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From; bh=TzLJ9jvfWc0RhA/kZpoBPRcWHVyOi6EsOwZPUgLWFvQ=; b=paO0ZRBUIhu+/X rD//+nB3truRs6YcqDdplOso4gItPM+G4J/AnPXqsbrpGZ6TPIHgAsdsYvwt7UqRmTLRkMzngt1gn mkgst/EE22yjSvZ3ZN4ihMH/4rmOVBMM0H84xkg8V/YE1i8LryDeGtwa6AufDMTdR+rqa7+pd8H6h gS8a7PSDPw1+ZDTK6M6JcnkVuMOmMGanY1qy0c3trIpbU9fLiuCFCSTDW/nqUz8EL81fs2zqSZMv7 zACJHR0J2w78RKKFVEjnojwyAEnHeEyzEFR3qN8baSWarZHhonKHzD+Z+s6hxsC0DPOEEKeN1Bp1D AYYUjhj+K4byNUdqSJww==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:45214 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cTuLu-001mju-S1; Wed, 18 Jan 2017 17:48:55 +0000 From: Guenter Roeck To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Sangwon Jee Subject: [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset and other changes Date: Wed, 18 Jan 2017 09:46:50 -0800 Message-Id: <1484761614-12225-30-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484761614-12225-1-git-send-email-linux@roeck-us.net> References: <1484761614-12225-1-git-send-email-linux@roeck-us.net> X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace devm_add_action() followed by failure action with devm_add_action_or_reset() This conversion was done automatically with coccinelle using the following semantic patches. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches - Replace devm_add_action() followed by failure action with devm_add_action_or_reset() - Replace 'goto l; ... l: return e;' with 'return e;' Signed-off-by: Guenter Roeck --- drivers/input/touchscreen/melfas_mip4.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c index 703d7f983d0a..3cad6f72dbf8 100644 --- a/drivers/input/touchscreen/melfas_mip4.c +++ b/drivers/input/touchscreen/melfas_mip4.c @@ -594,7 +594,7 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id) if (error) { dev_err(&client->dev, "Failed to read packet info: %d\n", error); - goto out; + return IRQ_HANDLED; } size = ts->buf[0] & 0x7F; @@ -604,7 +604,7 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id) /* Check size */ if (!size) { dev_err(&client->dev, "Empty packet\n"); - goto out; + return IRQ_HANDLED; } /* Read packet data */ @@ -614,7 +614,7 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id) if (error) { dev_err(&client->dev, "Failed to read packet data: %d\n", error); - goto out; + return IRQ_HANDLED; } if (alert) { @@ -629,7 +629,6 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id) input_sync(ts->input); } -out: return IRQ_HANDLED; } @@ -1531,9 +1530,8 @@ static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id) return error; } - error = devm_add_action(&client->dev, mip4_sysfs_remove, ts); + error = devm_add_action_or_reset(&client->dev, mip4_sysfs_remove, ts); if (error) { - mip4_sysfs_remove(ts); dev_err(&client->dev, "Failed to install sysfs remoce action: %d\n", error); return error;