diff mbox series

PCI: amlogic: Use PTR_ERR_OR_ZERO() to simplify code

Message ID 1574076329-48893-1-git-send-email-zhengbin13@huawei.com (mailing list archive)
State Not Applicable
Headers show
Series PCI: amlogic: Use PTR_ERR_OR_ZERO() to simplify code | expand

Commit Message

Zheng Bin Nov. 18, 2019, 11:25 a.m. UTC
Fixes coccicheck warning:

drivers/pci/controller/dwc/pci-meson.c:300:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/pci/controller/dwc/pci-meson.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--
2.7.4
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
index 3772b02..38902a6 100644
--- a/drivers/pci/controller/dwc/pci-meson.c
+++ b/drivers/pci/controller/dwc/pci-meson.c
@@ -297,10 +297,7 @@  static int meson_pcie_probe_clocks(struct meson_pcie *mp)
 		return PTR_ERR(res->general_clk);

 	res->clk = meson_pcie_probe_clock(dev, "pclk", 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)