Skip to contentSkip to conversation

PCI: faraday: fix inconsistent IS_ERR and PTR_ERR

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Oct 17, 2017 – Oct 20, 2017 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: faraday: fix inconsistent IS_ERR and PTR_ERR

Fix inconsistent IS_ERR and PTR_ERR in faraday_pci_probe. The proper pointer to be passed as argument is p->bus_clk.

This issue was detected with the help of Coccinelle.

---
This code was tested by compilation only.

 drivers/pci/host/pci-ftpci100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/host/pci-ftpci100.c +1 -1
index 06d9687..fae6bd1 100644
@@ -463,7 +463,7 @@ static int faraday_pci_probe(struct platform_device *pdev)
 	}
 	p->bus_clk = devm_clk_get(dev, "PCICLK");
 	if (IS_ERR(p->bus_clk))
-		return PTR_ERR(clk);
+		return PTR_ERR(p->bus_clk);
 	ret = clk_prepare_enable(p->bus_clk);
 	if (ret) {
 		dev_err(dev, "could not prepare PCICLK\n");
Signature · 1 line
2.7.4
#1 lore raw
Quoted 7 lines · Gustavo A. R. Silva

Fix inconsistent IS_ERR and PTR_ERR in faraday_pci_probe. The proper pointer to be passed as argument is p->bus_clk.

This issue was detected with the help of Coccinelle.

Huh, I merged the identical fix posted by Wei Yongjun 5 hours earlier :) Thanks!

Quoted 22 lines

---
This code was tested by compilation only.

 drivers/pci/host/pci-ftpci100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/host/pci-ftpci100.c +1 -1
index 06d9687..fae6bd1 100644
@@ -463,7 +463,7 @@ static int faraday_pci_probe(struct platform_device *pdev)
 	}
 	p->bus_clk = devm_clk_get(dev, "PCICLK");
 	if (IS_ERR(p->bus_clk))
-		return PTR_ERR(clk);
+		return PTR_ERR(p->bus_clk);
 	ret = clk_prepare_enable(p->bus_clk);
 	if (ret) {
 		dev_err(dev, "could not prepare PCICLK\n");
Signature · 1 line
2.7.4