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: 9147023 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 95C7F60761 for ; Wed, 1 Jun 2016 09:56:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 866F720093 for ; Wed, 1 Jun 2016 09:56:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AE0B26785; Wed, 1 Jun 2016 09:56:32 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 33E4C20093 for ; Wed, 1 Jun 2016 09:56:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b82rp-0001W1-9K; Wed, 01 Jun 2016 09:55:13 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b82rR-0000IM-L3 for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2016 09:54:50 +0000 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> for linux-arm-kernel@lists.infradead.org; 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160601_025449_910025_E5B73527 X-CRM114-Status: GOOD ( 17.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: r.baldyga@hackerion.com, Bartlomiej Zolnierkiewicz 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 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; }