From patchwork Fri May 6 07:27:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9029531 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 07B6F9F39D for ; Fri, 6 May 2016 07:28:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3839520389 for ; Fri, 6 May 2016 07:28:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F70C20381 for ; Fri, 6 May 2016 07:28:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758202AbcEFH1m (ORCPT ); Fri, 6 May 2016 03:27:42 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:58244 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751733AbcEFH1f (ORCPT ); Fri, 6 May 2016 03:27:35 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O6Q00HBEVDW3780@mailout1.w1.samsung.com>; Fri, 06 May 2016 08:27:32 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-65-572c4764e695 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id EA.22.05254.4674C275; Fri, 6 May 2016 08:27:32 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O6Q00378VDPR500@eusync1.samsung.com>; Fri, 06 May 2016 08:27:32 +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 v6 5/9] extcon: max8997: Fix handling error code of regmap_irq_get_virq() Date: Fri, 06 May 2016 09:27:12 +0200 Message-id: <1462519636-3250-4-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1462519636-3250-1-git-send-email-k.kozlowski@samsung.com> References: <1462519289-2356-2-git-send-email-k.kozlowski@samsung.com> <1462519636-3250-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42I5/e/4Zd0Ud51wg2WdzBZLLl5lt+i4tpjJ YuOM9awWUx8+YbO4/uU5q8WkJ++ZLeYfOcdqcXjRC0aLiSsnM1v0Xn3OaPH6haFF/+PXzBb3 vx5ltPh2pYPJYtPja6wWNz99Y7W4vGsOm8XWN+sYLT73HmG0mHF+H5PF7cYVbBZ3/31itNi9 6ymrxf7ODkaL07tLHCQ9nmy6yOixc9Zddo89E0+yeRzZeYzNY/MKLY9NqzrZPO5c2wPkLan3 2DP/B6tH35ZVjB7T5/1k8vi8SS6AJ4rLJiU1J7MstUjfLoErY/rLHcwFk9grjh87z9TA+Iy1 i5GTQ0LAROLi+6/MELaYxIV769m6GLk4hASWMkrc3P+BHcJpZJK4NfsSC0gVm4CxxOblS8Cq RAQ+sklcfv+MsYuRg4NZIFji51RGkBphgWiJV3vXsYPYLAKqEj9OTQfr5RVwk/hz5hk7xDY5 iZPHJoNdwSngLnFi4zWoZc2MEocXvWadwMi7gJFhFaNoamlyQXFSeq6hXnFibnFpXrpecn7u JkZILH3Zwbj4mNUhRgEORiUe3oyT2uFCrIllxZW5hxglOJiVRHj9XHTChXhTEiurUovy44tK c1KLDzFKc7AoifPO3fU+REggPbEkNTs1tSC1CCbLxMEp1cDoe28F7+aNq55fFJ1dd+2+0MIt 16en+36dG+y74+2lww7tsl56u6dcdv8XkN5n/uKrrexJceYK4bPv9CwWcjDWrzhhaTcvW03t 79rDUYLfNsT0HHuy+u7LIz06KY7agsuY2aaYPVtmWPw3qXvRL4m8rVvnFD+uUtu8t3xGmY6F xTunVrm/c4uClFiKMxINtZiLihMB0Nmw66ECAAA= Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.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; }