From patchwork Fri May 6 07:27:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9029641 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 26BB1BF29F for ; Fri, 6 May 2016 07:29:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E69020131 for ; Fri, 6 May 2016 07:29:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8265D2021B for ; Fri, 6 May 2016 07:29:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758073AbcEFH2h (ORCPT ); Fri, 6 May 2016 03:28:37 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:56354 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758050AbcEFH1k (ORCPT ); Fri, 6 May 2016 03:27:40 -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 <0O6Q00BMFVDXIX00@mailout2.w1.samsung.com>; Fri, 06 May 2016 08:27:33 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-8f-572c4764b2fb Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 9E.CE.04866.4674C275; Fri, 6 May 2016 08:27:33 +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 6/9] rtc: max8997: Check for ERRNO of regmap_irq_get_virq() Date: Fri, 06 May 2016 09:27:13 +0200 Message-id: <1462519636-3250-5-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+NgFupikeLIzCtJLcpLzFFi42I5/e/4Zd1Ud51wg+WTGS2WXLzKbtFxbTGT xcYZ61ktpj58wmZx/ctzVotJT94zW8w/co7V4vCiF4wWE1dOZrbovfqc0eL1C0OL/sevmS3u fz3KaPHtSgeTxabH11gtbn76xmpxedccNoutb9YxWnzuPcJoMeP8PiaL240r2Czu/vvEaLF7 11NWi/2dHYwWp3eXOEh6PNl0kdFj56y77B57Jp5k8ziy8xibx+YVWh6bVnWyedy5tgfIW1Lv sWf+D1aPvi2rGD2mz/vJ5PF5k1wATxSXTUpqTmZZapG+XQJXRvNl04IfrBXbtqg3MP5g6WLk 5JAQMJE4/m8ZE4QtJnHh3no2EFtIYCmjROsboBouILuRSeLW7EtgDWwCxhKbly9hA0mICHxk k7j8/hljFyMHB7NAsMTPqYwgNcICfhJb52wGq2cRUJW4dGYfG0gJr4CbxKTPlRC75CROHpvM CmJzCrhLnNh4jR1iVzOjxOFFr1knMPIuYGRYxSiaWppcUJyUnmukV5yYW1yal66XnJ+7iRES Q193MC49ZnWIUYCDUYmHN+OkdrgQa2JZcWXuIUYJDmYlEV4/F51wId6UxMqq1KL8+KLSnNTi Q4zSHCxK4rwzd70PERJITyxJzU5NLUgtgskycXBKNTDWH6g0uT5L+TrHus+Md80fSa1qs6g8 MG9zNreZzsGGXz1/nAoqn3L8/L+PvWn3r32rjidoNL32OKIazX/AyeLh0lcyqsnL7p7rudn5 Ve3+/wXiDxvW1y+pqQzfHt+5N/bLxxLBbzOlXk+0aTPRfKm+UqqgeZbo3ajKwss+LY7REk5P 2++5vH2pxFKckWioxVxUnAgANYTzip0CAAA= 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 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;