From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Xiaowei Song <songxiaowei@hisilicon.com>,
Binghui Wang <wangbinghui@hisilicon.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Rob Herring <robh@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-kernel@vger.kernel.org, linux-safety@lists.elisa.tech,
linux-pci@vger.kernel.org,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH] PCI: dwc: kirin: Use PTR_ERR_OR_ZERO
Date: Mon, 16 Nov 2020 16:44:03 +0000 [thread overview]
Message-ID: <20201116164403.25289-1-sudipm.mukherjee@gmail.com> (raw)
Coccinelle suggested using PTR_ERR_OR_ZERO() and looking at the code,
we can use PTR_ERR_OR_ZERO() instead of checking IS_ERR() and then
doing 'return 0'.
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
drivers/pci/controller/dwc/pcie-kirin.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c
index d0a6a2dee6f5..cf1379a8b950 100644
--- a/drivers/pci/controller/dwc/pcie-kirin.c
+++ b/drivers/pci/controller/dwc/pcie-kirin.c
@@ -138,10 +138,8 @@ 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,
@@ -169,10 +167,8 @@ 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)
--
2.11.0
reply other threads:[~2020-11-16 16:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201116164403.25289-1-sudipm.mukherjee@gmail.com \
--to=sudipm.mukherjee@gmail.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-safety@lists.elisa.tech \
--cc=lorenzo.pieralisi@arm.com \
--cc=robh@kernel.org \
--cc=songxiaowei@hisilicon.com \
--cc=wangbinghui@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).