From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FEBBC43387 for ; Thu, 3 Jan 2019 03:05:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0DFE5204EC for ; Thu, 3 Jan 2019 03:05:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Gx+I1ano" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DFE5204EC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org 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-30; 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org 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) _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic