From patchwork Wed Jun 1 09:53:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9147013 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 3B00160761 for ; Wed, 1 Jun 2016 09:56:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BA3E20093 for ; Wed, 1 Jun 2016 09:56:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2014326785; Wed, 1 Jun 2016 09:56:08 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 BF2F920093 for ; Wed, 1 Jun 2016 09:56:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758027AbcFAJzx (ORCPT ); Wed, 1 Jun 2016 05:55:53 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:62167 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932339AbcFAJya (ORCPT ); Wed, 1 Jun 2016 05:54:30 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O83006GM7IQD470@mailout4.w1.samsung.com>; Wed, 01 Jun 2016 10:54:26 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-2f-574eb0d2b77f Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id AE.32.05254.2D0BE475; Wed, 1 Jun 2016 10:54:26 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O8300COA7ICBX70@eusync2.samsung.com>; Wed, 01 Jun 2016 10:54:26 +0100 (BST) From: Krzysztof Kozlowski To: Kukjin Kim , Krzysztof Kozlowski , MyungJoo Ham , Chanwoo Choi , Dmitry Torokhov , Richard Purdie , Jacek Anaszewski , Lee Jones , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Liam Girdwood , Mark Brown , Alessandro Zummo , Alexandre Belloni , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-pm@vger.kernel.org, rtc-linux@googlegroups.com Cc: r.baldyga@hackerion.com, Bartlomiej Zolnierkiewicz Subject: [PATCH v7 4/6] extcon: max8997: Fix handling error code of regmap_irq_get_virq() Date: Wed, 01 Jun 2016 11:53:59 +0200 Message-id: <1464774841-1439-4-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1464774841-1439-1-git-send-email-k.kozlowski@samsung.com> References: <1464774841-1439-1-git-send-email-k.kozlowski@samsung.com> In-reply-to: <1464773339-756-1-git-send-email-k.kozlowski@samsung.com> References: <1464773339-756-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsVy+t/xK7qXNviFG9y4yW6x5OJVdouOa4uZ LDbOWM9qMfXhEzaL61+es1pMevKe2WL+kXOsFocXvWC0mLhyMrNF79XnjBavXxha9D9+zWxx /+tRRotvVzqYLDY9vsZqcfPTN1aLy7vmsFlsfbOO0eJz7xFGixnn9zFZ3G5cwWZx998nRovd u56yWuzv7GC0OL27xEHS48mmi4weO2fdZffYM/Ekm8eRncfYPDav0PLYtKqTzePOtT1A3pJ6 jz3zf7B69G1Zxegxfd5PJo/Pm+QCeKK4bFJSczLLUov07RK4Mg7s+8xccIi94vC2bWwNjBPZ uhg5OSQETCQ67/1nhrDFJC7cWw8U5+IQEljKKLFy629GCKeRSaLx4nGwDjYBY4nNy5eAVYkI fGSTuPz+GVAVBwezQLDEz6mMIDXCAtESnbv/sICEWQRUJaZdcwYJ8wq4SSz/vQ9qmZzEyWOT WUFsTgF3iftz7oCNFwKpeb6fCaSVE8j+eYYDxBQScJX4voJrAiP/AkaGVYyiqaXJBcVJ6bmG esWJucWleel6yfm5mxghMfdlB+PiY1aHGAU4GJV4eBUu+oYLsSaWFVfmHmKU4GBWEuGds8ov XIg3JbGyKrUoP76oNCe1+BCjNAeLkjjv3F3vQ4QE0hNLUrNTUwtSi2CyTBycUg2MQpHyatNn mlkdZjswfebFvwceqNobSGYd2pqvsPrQsVmPzE4WLH4Tu3rqurmJ7b98ouP2zK9U3Pgn5f/i OF9O8c3M0m1LFjw6926r6P7sR57G13/2n+k2dHRUENvyVPjP5t7Vf4usJxxWnv5G237dhYjO D1w3uWoW7Org+xxxSkZ6Xp7z5CTzB0osxRmJhlrMRcWJAMNMOG21AgAA 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 The regmap_irq_get_virq() can return negative ERRNO, so its result should not be stored in unsigned int because error would be ignored. Signed-off-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi --- drivers/extcon/extcon-max8997.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index 68754ac2c8ea..0afa3e8b5dc3 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c @@ -660,11 +660,11 @@ static int max8997_muic_probe(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(muic_irqs); i++) { struct max8997_muic_irq *muic_irq = &muic_irqs[i]; - unsigned int virq = 0; + int virq = 0; virq = regmap_irq_get_virq(max8997->irq_data_muic, muic_irq->irq); - if (!virq) { + if (virq <= 0) { ret = -EINVAL; goto err_irq; }