[PATCH -next] pci: mvebu: fix return value check in mvebu_pcie_probe()
Wei Yongjun
weiyj.lk at gmail.com
Mon May 27 13:38:41 EST 2013
From: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
In case of error, function of_clk_get_by_name() returns
ERR_PTR() never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
---
drivers/pci/host/pci-mvebu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 91106df..c8397c4 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -828,7 +828,7 @@ static int __init mvebu_pcie_probe(struct platform_device *pdev)
}
port->clk = of_clk_get_by_name(child, NULL);
- if (!port->clk) {
+ if (IS_ERR(port->clk)) {
dev_err(&pdev->dev, "PCIe%d.%d: cannot get clock\n",
port->port, port->lane);
iounmap(port->base);
More information about the devicetree-discuss
mailing list