* [PATCH] PCI: amlogic: Use PTR_ERR_OR_ZERO() to simplify code
@ 2019-11-18 11:25 zhengbin
0 siblings, 0 replies; only message in thread
From: zhengbin @ 2019-11-18 11:25 UTC (permalink / raw)
To: yue.wang, lorenzo.pieralisi, andrew.murray, bhelgaas, khilman,
linux-pci, linux-amlogic, linux-arm-kernel
Cc: zhengbin13
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(-)
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)
--
2.7.4
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-11-18 11:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18 11:25 [PATCH] PCI: amlogic: Use PTR_ERR_OR_ZERO() to simplify code zhengbin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®