From patchwork Wed Jun 1 09:54:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9146989 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 48F5960761 for ; Wed, 1 Jun 2016 09:55:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 394F52040D for ; Wed, 1 Jun 2016 09:55:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DAF12693F; Wed, 1 Jun 2016 09:55:19 +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 D106A2040D for ; Wed, 1 Jun 2016 09:55:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757861AbcFAJyf (ORCPT ); Wed, 1 Jun 2016 05:54:35 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:38543 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932345AbcFAJya (ORCPT ); Wed, 1 Jun 2016 05:54:30 -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 <0O8300G057IR5C70@mailout1.w1.samsung.com>; Wed, 01 Jun 2016 10:54:27 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-30-574eb0d39c00 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 40.42.05254.3D0BE475; Wed, 1 Jun 2016 10:54:27 +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:27 +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 5/6] rtc: max8997: Check for ERRNO of regmap_irq_get_virq() Date: Wed, 01 Jun 2016 11:54:00 +0200 Message-id: <1464774841-1439-5-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: H4sIAAAAAAAAAzWRbUhTYRiGfXd2zs6Gw+OyelOSuRBDyBoavJhUFNUhUAMLQX/Y1MMU3bQd lQwi/WFNQUtFNmS6aoZrVuo01G0kOV2YVpOpFX5RahNMht+atHJa/677eS6e+8dDYiIDN5jM VhYwKqUsV0IIuEPed6MnXG0JyaeGK3HUNDLGQ+pxAwe1a1txVPdtjkCf19w4qpnzYEjf/xFH 9qcLAFU/r8VQ5ZgboMUFKXo4u4ihmfUBgDZG1Rxknh3H0deVDRy5LDoCvf75CqDVyn6AtJ/e cNBEqZFAU94VgKyWeRz1lqsBGrIWnD9Cz5lHAN1TP8WjbdWDBN3f4yDoDmMkbTaVE/TkuG03 Nd2jbfotnK7qNAFa07jNoVfNodf8UwRxmUxudhGjOnn2piBr8E8Jnm8jbjfu6EEJ6MIrAJ+E VAz8srL+jw9B53QrUQEEpIh6BmDXgzF8P5RyoGnJyfNZBBUNO5qb9qwgapmALs8PUAFIEqOS 4HYd8DkHqAT4wdOJ+ZhLhcNug2VvLqQuQ43LDvbbQuGgo3avmU9dgTO6ScLHol2n2d3L8Z3k 7/L2MOlDEXUJbhoFj0DAY+BnAgeZwox8Nl2ukEaxMgVbqJRHZeQpzGD/dWvdwOCI7QMUCST+ QvFIfLIIlxWxxYo+AElMEiTUmRKSRcJMWfEdRpWXpirMZdg+EEJyJYeFDRbPdREllxUwOQyT z6j+bzkkP7gEJLlgTUNVtLQ94oWmjO1y7TgXJTtP4hO33JpjLb/SG9OOls5PtKUuW7PfvqxK SZUev6slwk/by8SBbLpkur7d5XAZb7X+tluNbbqrHRHeG/PlYrYlLDFIHBJWM6DPsMckKnnT AbE579ei1dqlC36CjUDvxTjnpvx7hOr+mXMSLpslk0ZiKlb2F3r2V6S2AgAA 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 zero or negative ERRNO, so it is insufficient to check only for non-zero value. Signed-off-by: Krzysztof Kozlowski Acked-by: Alexandre Belloni --- drivers/rtc/rtc-max8997.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c index 4998aee0f07f..1a06e17ebe9b 100644 --- a/drivers/rtc/rtc-max8997.c +++ b/drivers/rtc/rtc-max8997.c @@ -497,7 +497,7 @@ static int max8997_rtc_probe(struct platform_device *pdev) } virq = regmap_irq_get_virq(max8997->irq_data, MAX8997_PMICIRQ_RTCA1); - if (!virq) { + if (virq <= 0) { dev_err(&pdev->dev, "Failed to create mapping alarm IRQ\n"); ret = -ENXIO; goto err_out;