From patchwork Fri Jun 17 06:10:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9182511 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 3F29360776 for ; Fri, 17 Jun 2016 06:11:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FCBD27248 for ; Fri, 17 Jun 2016 06:11:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23E4D283A9; Fri, 17 Jun 2016 06:11:06 +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 372FD27248 for ; Fri, 17 Jun 2016 06:11:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755243AbcFQGKu (ORCPT ); Fri, 17 Jun 2016 02:10:50 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:27782 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755218AbcFQGKr (ORCPT ); Fri, 17 Jun 2016 02:10:47 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O8W009KDJTW2X10@mailout2.w1.samsung.com>; Fri, 17 Jun 2016 07:10:44 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-11-576394643056 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id CC.ED.04866.46493675; Fri, 17 Jun 2016 07:10:44 +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:44 +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 5/6] rtc: max8997: Check for ERRNO of regmap_irq_get_virq() Date: Fri, 17 Jun 2016 08:10:32 +0200 Message-id: <1466143833-5856-6-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+NgFupmkeLIzCtJLcpLzFFi42I5/e/4Vd2UKcnhBifvslosuXiV3aLj2mIm i40z1rNaTH34hM3i+pfnrBaTnrxntph/5ByrxeFFLxgtJq6czGzRe/U5o8XrF4YW/Y9fM1vc /3qU0eLblQ4mi02Pr7Fa3Pz0jdXi8q45bBZb36xjtPjce4TRYsb5fUwWtxtXsFnc/feJ0WL3 rqesFvs7OxgtTu8ucZD0eLLpIqPHzll32T32TDzJ5nFk5zE2j80rtDw2repk87hzbQ+Qt6Te Y8/8H6wefVtWMXpMn/eTyePzJrkAnigum5TUnMyy1CJ9uwSujJP/G1gL9rBVzPs9n7GBcTtr FyMHh4SAicTc48VdjJxAppjEhXvr2boYuTiEBJYySnRfus8C4TQySfQ3rmYGqWITMJbYvHwJ WJWIwEc2icvvnzGCTGIWCJb4OZURpEZYwF/i3PpeNhCbRUBV4tXLFjaQEl4BN4n2tbEQy+Qk Th6bzApicwq4S3TNvsMOYgsBlWze/4d5AiPvAkaGVYyiqaXJBcVJ6blGesWJucWleel6yfm5 mxghUfR1B+PSY1aHGAU4GJV4eFeIJocLsSaWFVfmHmKU4GBWEuEtmQQU4k1JrKxKLcqPLyrN SS0+xCjNwaIkzjtz1/sQIYH0xJLU7NTUgtQimCwTB6dUA6Oacspiz7r52ncWRHy7tKLmYb9e rMCds0a2eU6Sec4zvnpocr2a0vBuh+v6Iy/C3Z2uvXz+955YcM0b3lO/vxtrfDQvd86+JsYl y3nn+C6FckUjluN73ohxTDrb/EDyQPPkJRdrT9Vy+M0+qPXil1Wx0H1Jn4cMv/RqwsWEWGs2 7g67Y3DA65QSS3FGoqEWc1FxIgAMOBXlngIAAA== 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 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;