From patchwork Wed Jan 18 17:46:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9524397 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 0326760113 for ; Wed, 18 Jan 2017 17:48:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E57B728606 for ; Wed, 18 Jan 2017 17:48:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D849C28623; Wed, 18 Jan 2017 17:48:17 +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=unavailable 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 6BDE728606 for ; Wed, 18 Jan 2017 17:48:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752922AbdARRrY (ORCPT ); Wed, 18 Jan 2017 12:47:24 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:56737 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752915AbdARRrW (ORCPT ); Wed, 18 Jan 2017 12:47:22 -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=60Ec2fRoCFGx2nqqyBrlzdefyDZHRqSjSPH60B5oiGA=; b=WWFORXXIx/Poe/ nSFIt1XzyqVfxatOPe1w+gpAdw1MDRX0jeWS4NoIbyk+CBHm/aa6bJo1pnupm5JAR7T2hj2EP9TZG Ols6w2fe6U8HwpKsbXefmlMtrPoX+LfrfTjqQ1XkaB+mdmhKWmkzlxIk8mtJMj+mm5mQl0OUhM5We 4XOS0e4D6JtGn87Sr0xmfYzQpRj3q9axTva1xeOa1GFiOa3WPA7vMoEZWCCwKhEkkfEg+G1oRc571 FSw8b31tp593S8jsIxQrWi7hQxsob4BzvtI+SOYc7JWx3L1DyQBi6+c6BD+7/7cUGcSVVWRKWQuFO JkAnRGHtPKWdrUUt4wbA==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:45146 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cTuKO-001ifD-Eo; Wed, 18 Jan 2017 17:47:20 +0000 From: Guenter Roeck To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Amitoj Kaur Chawla Subject: [PATCH 03/33] Input: cap11xx - Drop unnecessary call to i2c_set_clientdata and other changes Date: Wed, 18 Jan 2017 09:46:24 -0800 Message-Id: <1484761614-12225-4-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 There is no call to i2c_get_clientdata() or dev_get_drvdata(). Drop the unnecessary call to i2c_set_clientdata(). Other relevant changes: Simplify error return 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 'goto l; ... l: return e;' with 'return e;' - Replace 'if (e) return e; return 0;' with 'return e;' - Drop i2c_set_clientdata() Signed-off-by: Guenter Roeck --- drivers/input/keyboard/cap11xx.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c index 4401be225d64..9cbba2dd0e29 100644 --- a/drivers/input/keyboard/cap11xx.c +++ b/drivers/input/keyboard/cap11xx.c @@ -189,11 +189,11 @@ static irqreturn_t cap11xx_thread_func(int irq_num, void *data) */ ret = regmap_update_bits(priv->regmap, CAP11XX_REG_MAIN_CONTROL, 1, 0); if (ret < 0) - goto out; + return IRQ_HANDLED; ret = regmap_read(priv->regmap, CAP11XX_REG_SENSOR_INPUT, &status); if (ret < 0) - goto out; + return IRQ_HANDLED; for (i = 0; i < priv->idev->keycodemax; i++) input_report_key(priv->idev, priv->keycodes[i], @@ -201,7 +201,6 @@ static irqreturn_t cap11xx_thread_func(int irq_num, void *data) input_sync(priv->idev); -out: return IRQ_HANDLED; } @@ -392,7 +391,6 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client, return error; dev_info(dev, "CAP11XX detected, revision 0x%02x\n", rev); - i2c_set_clientdata(i2c_client, priv); node = dev->of_node; if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) { @@ -476,12 +474,8 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client, return -ENXIO; } - error = devm_request_threaded_irq(dev, irq, NULL, cap11xx_thread_func, - IRQF_ONESHOT, dev_name(dev), priv); - if (error) - return error; - - return 0; + return devm_request_threaded_irq(dev, irq, NULL, cap11xx_thread_func, + IRQF_ONESHOT, dev_name(dev), priv); } static const struct of_device_id cap11xx_dt_ids[] = {