From patchwork Tue Aug 29 13:46:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Jha X-Patchwork-Id: 9927397 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 8D3CD60380 for ; Tue, 29 Aug 2017 13:47:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DC93288FA for ; Tue, 29 Aug 2017 13:47:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 726B128903; Tue, 29 Aug 2017 13:47:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Flag: YES X-Spam-Level: **** X-Spam-Status: Yes, score=4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_LOW, RCVD_IN_SBL_CSS,RCVD_IN_SORBS_SPAM,RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 X-Spam-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [65.50.211.133 listed in list.dnswl.org] * 1.3 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net * [Blocked - see ] * 3.3 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS * [103.254.204.108 listed in zen.spamhaus.org] * 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source * [103.254.204.108 listed in dnsbl.sorbs.net] * 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (himanshujha199640[at]gmail.com) * 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is * CUSTOM_MED * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0975D288FA for ; Tue, 29 Aug 2017 13:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=k4f1J7waTuH9/Q1ILIjhgdh8Wd/z+gNXdCgLzg/0YeU=; b=cx4 AhAVIAnvdqZDm7oTNfWExLwGFc1j3WPe9/t3FikFaVbHyxNPMJHxsgv3GlvJ5JAK6ukCwAlQ6htYJ CuqXVcT7CIAWqrtC0oNJ53YfZ+BNFIV53q/ppck4co73YxdxuxKtOZmFDFkmC4p4GGj2gBlslODwx ReVip/e/51t0JixB9CwS9i40i7fAF1yu94jU+5AL/Tlm3LZpaNCn6Q4yuhAnCH9EWcg6FkqqHucuF QZUfUDl47PURA9+sm1z6qdeN0IemSqX45Ae2N7iLQhbGRneJ2GqlPsTQzhHgClQe35uE5Ddhy4rlS BlElNk8Q47jEVP1JeBurrKl9nLTbQxw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dmgrl-0006bH-9V; Tue, 29 Aug 2017 13:47:41 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dmgrg-0006ZC-9Q for linux-arm-kernel@lists.infradead.org; Tue, 29 Aug 2017 13:47:39 +0000 Received: by mail-pf0-x244.google.com with SMTP id r187so2363022pfr.5 for ; Tue, 29 Aug 2017 06:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=beVQl25dumij1imZZijPDcX7RdnNLMSJWkmOU9nQiHs=; b=p2C5WZxkxyQW/KXYBcyc2a8j0uQrbeDwdd8P45dQZA6ZfDEINQymrd2BEwTfK6P17Z r8a6+WG+MIG1+rfPXs7ByxLuXl04F4PJK91QRG3x57h0ixw3RdO65z+Q9FHKMnQ9QdHg 2VYvVYpY34N/YssC72jiFeEd42VyTThPYfii5sToQI2W7Wbgwt+F8xZ7uhTSqFBJ2rej PkEQgHBIoRupX2TtGBwRV2ArWFfbKAojKP4HAMNM+EOQj1pts3mXYenIeItlEcUNsU+A 6Ho2+Jrdjm/awWmjhd/n16fehNnpzB+ISXw1rty6iCeAV2fdTG9SEGsklvMTQW2VRkA0 ep/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=beVQl25dumij1imZZijPDcX7RdnNLMSJWkmOU9nQiHs=; b=Qy8k0+/FutTcMmwbQ6HZBIYHXn8ErlVdw8lZCLL6m6/1oS6D8yMm1YzfDct3Im9/kP TBXy7zvc7qaKWiWi2ziwoLcxj6LY6dwU3gslf7a1risVsZ6ZYKN01VWZPufSAm/qyxqM MNEvkhkvaoAvDSa51ztWuPbZ60NQhbC+we8S6Ii+KaayfAQb08fDTJZBUWZdjbN5BHTa JgRkV47Di9y8p3I4GNMmq7fXcCZeQzbUn8xuk8qTjs7A68Nau+QQm0ylbmfAv08Ff7Ai Q/gWcRhRAPwFVA0WDJe0g1F/EwytwG1ZBMUlrh6qWOlgHPeUuybiKoFQ8SH3nZw4Rqgr 3uPg== X-Gm-Message-State: AHYfb5hO90v4/qNKb/5StQyQhKUusPtclyOFtvihzpXuFXb61m+WCDJ+ fkRM859UcqUUUw== X-Google-Smtp-Source: ADKCNb4FyOcHNOq1EkTVt4BmJbtwIh0j8GUQ/qkDfv94fQUnebZfdS/+FtKIZn09p1e0BdtARQwKEQ== X-Received: by 10.99.160.80 with SMTP id u16mr394457pgn.62.1504014435481; Tue, 29 Aug 2017 06:47:15 -0700 (PDT) Received: from localhost.localdomain ([103.254.204.108]) by smtp.gmail.com with ESMTPSA id t75sm4987354pfk.154.2017.08.29.06.47.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Aug 2017 06:47:14 -0700 (PDT) From: Himanshu Jha To: a.zummo@towertech.it Subject: [PATCH] rtc: Use PTR_ERR_OR_ZERO Date: Tue, 29 Aug 2017 19:16:59 +0530 Message-Id: <1504014419-16894-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170829_064736_469695_2772CEFE X-CRM114-Status: GOOD ( 10.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rtc@vger.kernel.org, baruch@tkos.co.il, linux-kernel@vger.kernel.org, alexandre.belloni@free-electrons.com, Himanshu Jha , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Signed-off-by: Himanshu Jha --- drivers/rtc/rtc-digicolor.c | 5 +---- drivers/rtc/rtc-ds1347.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/rtc/rtc-digicolor.c b/drivers/rtc/rtc-digicolor.c index b253bf1..1e200a0 100644 --- a/drivers/rtc/rtc-digicolor.c +++ b/drivers/rtc/rtc-digicolor.c @@ -202,10 +202,7 @@ static int __init dc_rtc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, rtc); rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, pdev->name, &dc_rtc_ops, THIS_MODULE); - if (IS_ERR(rtc->rtc_dev)) - return PTR_ERR(rtc->rtc_dev); - - return 0; + return PTR_ERR_OR_ZERO(rtc->rtc_dev); } static const struct of_device_id dc_dt_ids[] = { diff --git a/drivers/rtc/rtc-ds1347.c b/drivers/rtc/rtc-ds1347.c index ccfc9d4..9a02ca7 100644 --- a/drivers/rtc/rtc-ds1347.c +++ b/drivers/rtc/rtc-ds1347.c @@ -155,10 +155,7 @@ static int ds1347_probe(struct spi_device *spi) rtc = devm_rtc_device_register(&spi->dev, "ds1347", &ds1347_rtc_ops, THIS_MODULE); - if (IS_ERR(rtc)) - return PTR_ERR(rtc); - - return 0; + return PTR_ERR_OR_ZERO(rtc); } static struct spi_driver ds1347_driver = {