From patchwork Fri Jun 17 06:10:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9182523 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 68C1560776 for ; Fri, 17 Jun 2016 06:11:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 590942839F for ; Fri, 17 Jun 2016 06:11:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B6BD27248; Fri, 17 Jun 2016 06:11:33 +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 C541827248 for ; Fri, 17 Jun 2016 06:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755308AbcFQGKx (ORCPT ); Fri, 17 Jun 2016 02:10:53 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:31567 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755239AbcFQGKs (ORCPT ); Fri, 17 Jun 2016 02:10:48 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O8W006XEJTVR080@mailout1.w1.samsung.com>; Fri, 17 Jun 2016 07:10:43 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-0c-57639463d36a Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id CA.ED.04866.36493675; Fri, 17 Jun 2016 07:10:43 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O8W0019NJTNFW30@eusync3.samsung.com>; Fri, 17 Jun 2016 07:10:43 +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: [RESEND v7 4/6] extcon: max8997: Fix handling error code of regmap_irq_get_virq() Date: Fri, 17 Jun 2016 08:10:31 +0200 Message-id: <1466143833-5856-5-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1466143833-5856-1-git-send-email-k.kozlowski@samsung.com> References: <1466143833-5856-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42I5/e/4Vd3kKcnhBpsb2C2WXLzKbtFxbTGT xcYZ61ktpj58wmZx/ctzVotJT94zW8w/co7V4vCiF4wWE1dOZrbovfqc0eL1C0OL/sevmS3u fz3KaPHtSgeTxabH11gtbn76xmpxedccNoutb9YxWnzuPcJoMeP8PiaL240r2Czu/vvEaLF7 11NWi/2dHYwWp3eXOEh6PNl0kdFj56y77B57Jp5k8ziy8xibx+YVWh6bVnWyedy5tgfIW1Lv sWf+D1aPvi2rGD2mz/vJ5PF5k1wATxSXTUpqTmZZapG+XQJXxoF9n5kLDrFXHN62ja2BcSJb FyMnh4SAicSOee+YIWwxiQv31gPFuTiEBJYyStzf18kK4TQySbw+1w9WxSZgLLF5+RKwKhGB j2wSl98/Y+xi5OBgFgiW+DmVEaRGWCBG4ti6drB6FgFVif/NP5hASngF3CRu9otCLJOTOHls MiuIzSngLtE1+w47iC0EVLJ5/x/mCYy8CxgZVjGKppYmFxQnpeca6RUn5haX5qXrJefnbmKE xNHXHYxLj1kdYhTgYFTi4V0hmhwuxJpYVlyZe4hRgoNZSYS3ZBJQiDclsbIqtSg/vqg0J7X4 EKM0B4uSOO/MXe9DhATSE0tSs1NTC1KLYLJMHJxSDYzbL2kmn52++WDnbS2NwGsl8V9dmbNX eMyL/sBWtcLx1JZj519tdDyhXDLl/3epgjy2sqbV854avd8quWO7Ks/2xcoVG4++tuxyUouL nM0dYnuj0WrFEfllu6yFdu7U/tX7bqPW8nMSu5q+29XaPpTfO/eUZW686aUrVlfePI1d2ucd 4cMXYvpUiaU4I9FQi7moOBEA2nlYAp8CAAA= Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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; }