From patchwork Tue Aug 29 13:35:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Jha X-Patchwork-Id: 9927373 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 965DB60383 for ; Tue, 29 Aug 2017 13:36:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82CAD28817 for ; Tue, 29 Aug 2017 13:36:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 773611FF82; Tue, 29 Aug 2017 13:36:42 +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 DECBF1FF82 for ; Tue, 29 Aug 2017 13:36:41 +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=tGVWaGKOOr4XdBASNHh+QC8g0SfFFK8iVG6k2gypoRM=; b=Y14 0+b3QkHaVxReQJ5g9dFqbiCAwI+2kj1yXaZx5khZ1votgNMbvHOfnFtSSTFS3hUL6wpJIy6iVYaDP TUimPknepM8n/PhHfyXcydZ4bLD0rnzaDCYIvcsmJm9YYSSKKpcKvL05qX/WwKxK2BBmEILGP8IqT XHLh8hR2/2bjBZc7kGjQLHa7sGUDy6u2hX4HsNEKX8DnvM300Ku2a/wvKlm5kMhqMcqBnZi4Lg2Kt B3FitNutUhR9shIVJH68cB1vcHsJGfmDODbCYdE9unPEuiih7B/T4VLTWa5blCi3ePihhRZ5uwkZ8 qtA7usfkwDGuyT6EL42q9lbCsQLxUuA==; 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 1dmgh1-0002Lf-7H; Tue, 29 Aug 2017 13:36:35 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dmggs-0002JI-IA for linux-arm-kernel@lists.infradead.org; Tue, 29 Aug 2017 13:36:32 +0000 Received: by mail-pf0-x241.google.com with SMTP id g13so2359901pfm.2 for ; Tue, 29 Aug 2017 06:36:05 -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=W98GRENRnB7HHXkEM/xU8p0f9r8ctbSOjkj/GGo79tE=; b=lHwfR2ItJEZu/6GvyGf55U+Ys00E1GUtVET5YpSyEtqVNt+YOoLxhl+9jc3bN1DfA6 TiAjmOK+aZw+1ERf60TDh0Swat5DbkPM8QGm3jioTZq8fu2IO9DClg8ZS/4LzDEi9HOn JWvs1OFDEvuY8UYzvoQsoW/D9mxq4ieT3BHslIRSg19dZJnfJEao6TnwvmrIHt/VLogz 4+20ixHFO48bXC+URL4bqQ95LgfbhI2ZHoV3IC7Zpw2KutQb+go/TmP68moC+fQy3875 zaqN7kNcEPJtzuxtmAdEEWOwIlmA3doWIzUkuPep655+RUSviXcQHrq71bbshridXf2z mPxg== 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=W98GRENRnB7HHXkEM/xU8p0f9r8ctbSOjkj/GGo79tE=; b=W1mxLqOwBmIVvxsX/hPyizyCZX8sZ9BOLJkXyDAR2UhBFQEEAV0X35Gxt6qANepMDl gC4t+Fz75G/ph5AUqePK9DOv6/Vg6hZFoH3zvFXeSa21z12YjAdz+ASh9VyrbdkixTkb h2xRM9QUDmlUd+/8qdU5KqM+FMY2xLNu4pxBm2sCNlsgykE4ubt+rEZTFJWfepkqCBR0 +sM2GmCE7NDk4BFq1Go4Ce1IFVF+F/vEl91o+KpIV6cIXgCLVGT2sqphej9pjiwtUPH+ tNk+N9TOVDM0q+QadQbiahuKpfUZBpd/mduqLEXcZGdNNAe9iHCh9U+uvXzh8tRVBzpu hvSQ== X-Gm-Message-State: AHYfb5iKK9KkeThBEec0R2ad2ZNwBrUP3tZVi4WIivN3gqLMc+bPnag1 c0O9FwaGUKEleA== X-Google-Smtp-Source: ADKCNb4lQh/XV+qaxiCMQiEwYf6KajhwVI8iWdhKvq4Y4z4k5SC1F9Lm2HiLC2AxXfiIsHJKveRqzQ== X-Received: by 10.84.231.2 with SMTP id f2mr447719plk.171.1504013764474; Tue, 29 Aug 2017 06:36:04 -0700 (PDT) Received: from localhost.localdomain ([103.254.204.108]) by smtp.gmail.com with ESMTPSA id p5sm3309259pgn.91.2017.08.29.06.35.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Aug 2017 06:36:03 -0700 (PDT) From: Himanshu Jha To: jingoohan1@gmail.com Subject: [PATCH] PCI: dwc: Use PTR_ERR_OR_ZERO Date: Tue, 29 Aug 2017 19:05:32 +0530 Message-Id: <1504013732-16112-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_063626_646238_A51C4CB6 X-CRM114-Status: GOOD ( 10.36 ) 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-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, wangbinghui@hisilicon.com, linux-kernel@vger.kernel.org, krzk@kernel.org, svarbanov@mm-sol.com, Himanshu Jha , bhelgaas@google.com, 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/pci/dwc/pci-exynos.c | 5 +---- drivers/pci/dwc/pcie-kirin.c | 10 ++-------- drivers/pci/dwc/pcie-qcom.c | 5 +---- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c index f77f872..1880518 100644 --- a/drivers/pci/dwc/pci-exynos.c +++ b/drivers/pci/dwc/pci-exynos.c @@ -152,10 +152,7 @@ static int exynos5440_pcie_get_mem_resources(struct platform_device *pdev, res = platform_get_resource(pdev, IORESOURCE_MEM, 2); ep->mem_res->block_base = devm_ioremap_resource(dev, res); - if (IS_ERR(ep->mem_res->block_base)) - return PTR_ERR(ep->mem_res->block_base); - - return 0; + return PTR_ERR_OR_ZERO(ep->mem_res->block_base); } static int exynos5440_pcie_get_clk_resources(struct exynos_pcie *ep) diff --git a/drivers/pci/dwc/pcie-kirin.c b/drivers/pci/dwc/pcie-kirin.c index dc3033c..bf327eb 100644 --- a/drivers/pci/dwc/pcie-kirin.c +++ b/drivers/pci/dwc/pcie-kirin.c @@ -142,10 +142,7 @@ static long kirin_pcie_get_clk(struct kirin_pcie *kirin_pcie, return PTR_ERR(kirin_pcie->apb_sys_clk); kirin_pcie->pcie_aclk = devm_clk_get(dev, "pcie_aclk"); - if (IS_ERR(kirin_pcie->pcie_aclk)) - return PTR_ERR(kirin_pcie->pcie_aclk); - - return 0; + return PTR_ERR_OR_ZERO(kirin_pcie->pcie_aclk); } static long kirin_pcie_get_resource(struct kirin_pcie *kirin_pcie, @@ -178,10 +175,7 @@ static long kirin_pcie_get_resource(struct kirin_pcie *kirin_pcie, kirin_pcie->sysctrl = syscon_regmap_lookup_by_compatible("hisilicon,hi3660-sctrl"); - if (IS_ERR(kirin_pcie->sysctrl)) - return PTR_ERR(kirin_pcie->sysctrl); - - return 0; + return PTR_ERR_OR_ZERO(kirin_pcie->sysctrl); } static int kirin_pcie_phy_init(struct kirin_pcie *kirin_pcie) diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c index 871e7d9..7ec92ef 100644 --- a/drivers/pci/dwc/pcie-qcom.c +++ b/drivers/pci/dwc/pcie-qcom.c @@ -679,10 +679,7 @@ static int qcom_pcie_get_resources_v3(struct qcom_pcie *pcie) return PTR_ERR(res->ahb_reset); res->phy_ahb_reset = devm_reset_control_get_exclusive(dev, "phy_ahb"); - if (IS_ERR(res->phy_ahb_reset)) - return PTR_ERR(res->phy_ahb_reset); - - return 0; + return PTR_ERR_OR_ZERO(res->phy_ahb_reset); } static void qcom_pcie_deinit_v3(struct qcom_pcie *pcie)