From patchwork Thu Jan 3 03:12:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 10746915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 57ED46C2 for ; Thu, 3 Jan 2019 03:05:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4697F28509 for ; Thu, 3 Jan 2019 03:05:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A0DD285A5; Thu, 3 Jan 2019 03:05:51 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 E7A4A28509 for ; Thu, 3 Jan 2019 03:05:50 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=cRJqxeukeOjaWBLrjhkEf9HqhFgnoMl5gsDjEVQfzVs=; b=Gx+I1anoJbqtmC opexzsvVrEo52tlD6npgYP0zWfvTsgiJ5XdIAUyPfxECaVk8e92SbwdcbGY4Y3+Du4ilaLfiUgWcO iVz7h8mdixnCzvnEtz05YlSAkTNvHv1Y1rLdHJkhE6oL8dh0hIFCkU/JsWjaW9k2qvIdLmFIMNGU1 8kpRBnyY3zsFSu5CKttfcWKJUUEzY39GB6pHYdpnJmbKJkK44rU3TK2qqvwcEDB6DzfsUO2qSCYxc ZRu3v2bcB+I1+aAjkCw1YIFNqJ/Ko+NB+ViFsW6n0mS7cLKJanrHotRvSD4iONuvzmd4oE16iVrsP UKURI/T93NepRqJYgz8g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1getKQ-00077A-1w; Thu, 03 Jan 2019 03:05:50 +0000 Received: from szxga06-in.huawei.com ([45.249.212.32] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1getKM-00076U-RP; Thu, 03 Jan 2019 03:05:48 +0000 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 10DC520D0CC70; Thu, 3 Jan 2019 11:05:38 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.408.0; Thu, 3 Jan 2019 11:05:31 +0800 From: YueHaibing To: Yue Wang , Lorenzo Pieralisi , Bjorn Helgaas , "Kevin Hilman" Subject: [PATCH -next] PCI: amlogic: Use PTR_ERR_OR_ZERO Date: Thu, 3 Jan 2019 03:12:18 +0000 Message-ID: <1546485138-142830-1-git-send-email-yuehaibing@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190102_190547_060723_FF3E9202 X-CRM114-Status: UNSURE ( 7.80 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-pci@vger.kernel.org, kernel-janitors@vger.kernel.org, YueHaibing , linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=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: YueHaibing --- drivers/pci/controller/dwc/pci-meson.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c index 241ebe0..51cf20c 100644 --- a/drivers/pci/controller/dwc/pci-meson.c +++ b/drivers/pci/controller/dwc/pci-meson.c @@ -181,10 +181,7 @@ static int meson_pcie_get_mems(struct platform_device *pdev, /* Meson SoC has two PCI controllers use same phy register*/ mp->mem_res.phy_base = meson_pcie_get_mem_shared(pdev, mp, "phy"); - if (IS_ERR(mp->mem_res.phy_base)) - return PTR_ERR(mp->mem_res.phy_base); - - return 0; + return PTR_ERR_OR_ZERO(mp->mem_res.phy_base); } static void meson_pcie_power_on(struct meson_pcie *mp) @@ -258,10 +255,7 @@ static int meson_pcie_probe_clocks(struct meson_pcie *mp) return PTR_ERR(res->general_clk); res->clk = meson_pcie_probe_clock(dev, "pcie", 0); - if (IS_ERR(res->clk)) - return PTR_ERR(res->clk); - - return 0; + return PTR_ERR_OR_ZERO(res->clk); } static inline void meson_elb_writel(struct meson_pcie *mp, u32 val, u32 reg)