Skip to contentSkip to conversation

PCI: exynos: missing clk_disable_unprepare() on error in exynos_pcie_probe()

PATCH New Wei Yongjun 4 participants 5 messages Sep 29, 2013 – Oct 4, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: exynos: missing clk_disable_unprepare() on error in exynos_pcie_probe()

From: Wei Yongjun <[email protected]>

Add the missing clk_disable_unprepare() before return from exynos_pcie_probe() in the error handling case.

---
 drivers/pci/host/pci-exynos.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/pci/host/pci-exynos.c +12 -6
index 94e096b..e25598a 100644
@@ -487,18 +487,24 @@ static int __init exynos_pcie_probe(struct platform_device *pdev)
 
 	elbi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	exynos_pcie->elbi_base = devm_ioremap_resource(&pdev->dev, elbi_base);
-	if (IS_ERR(exynos_pcie->elbi_base))
-		return PTR_ERR(exynos_pcie->elbi_base);
+	if (IS_ERR(exynos_pcie->elbi_base)) {
+		ret = PTR_ERR(exynos_pcie->elbi_base);
+		goto fail_bus_clk;
+	}
 
 	phy_base = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	exynos_pcie->phy_base = devm_ioremap_resource(&pdev->dev, phy_base);
-	if (IS_ERR(exynos_pcie->phy_base))
-		return PTR_ERR(exynos_pcie->phy_base);
+	if (IS_ERR(exynos_pcie->phy_base)) {
+		ret = PTR_ERR(exynos_pcie->phy_base);
+		goto fail_bus_clk;
+	}
 
 	block_base = platform_get_resource(pdev, IORESOURCE_MEM, 2);
 	exynos_pcie->block_base = devm_ioremap_resource(&pdev->dev, block_base);
-	if (IS_ERR(exynos_pcie->block_base))
-		return PTR_ERR(exynos_pcie->block_base);
+	if (IS_ERR(exynos_pcie->block_base)) {
+		ret = PTR_ERR(exynos_pcie->block_base);
+		goto fail_bus_clk;
+	}
 
 	ret = add_pcie_port(pp, pdev);
 	if (ret < 0)
#1 lore raw

PATCH 1/1 PCI: exynos: missing clk_disable_unprepare() on error in exynos_pcie_probe()

Quoted 7 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Add the missing clk_disable_unprepare() before return from exynos_pcie_probe() in the error handling case.

However, the commit name should be fixed as below:
[PATCH] PCI: exynos: use missing clk_disable_unprepare() on error in exynos_pcie_probe()

Best regards,
Jingoo Han

Quoted 4 lines
---
 drivers/pci/host/pci-exynos.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
#2 lore raw

PATCH 1/1 PCI: exynos: missing clk_disable_unprepare() on error in exynos_pcie_probe()

Quoted 7 lines · Jingoo Han
Quoted 6 lines · Wei Yongjun

From: Wei Yongjun<[email protected]>

Add the missing clk_disable_unprepare() before return from exynos_pcie_probe() in the error handling case.

Quoted 6 lines
Quoted 1 line

However, the commit name should be fixed as below:
[PATCH] PCI: exynos: use missing clk_disable_unprepare() on error in exynos_pcie_probe()

Perhaps just:

"PCI: exynos: Add missing clk_disable_unprepare() on error path

How can something that is missing be used ? :)

#3 lore raw

PATCH 1/1 PCI: exynos: missing clk_disable_unprepare() on error in exynos_pcie_probe()

Quoted 12 lines · Sylwester Nawrocki
Quoted 11 lines · Jingoo Han
Quoted 7 lines · Wei Yongjun

From: Wei Yongjun<[email protected]>

Add the missing clk_disable_unprepare() before return from exynos_pcie_probe() in the error handling case.

Quoted 8 lines
Quoted 2 lines

However, the commit name should be fixed as below:
[PATCH] PCI: exynos: use missing clk_disable_unprepare() on error in exynos_pcie_probe()

Perhaps just:

"PCI: exynos: Add missing clk_disable_unprepare() on error path

How can something that is missing be used ? :)

Hi Sylwester Nawrocki,

OK, I see.
The following looks good, as you mentioned.
[PATCH] PCI: exynos: Add missing clk_disable_unprepare() on error path

Thank you for your comment. :-)

Best regards,
Jingoo Han

maintainer
#4 lore raw

PATCH 1/1 PCI: exynos: missing clk_disable_unprepare() on error in exynos_pcie_probe()

In reply to Wei Yongjun
Quoted 6 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Add the missing clk_disable_unprepare() before return from exynos_pcie_probe() in the error handling case.

Applied with Jingoo's ack and Sylwester's subject line to pci/host-exynos. Thanks!

Bjorn

Quoted 40 lines
---
 drivers/pci/host/pci-exynos.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/pci/host/pci-exynos.c +12 -6
index 94e096b..e25598a 100644
@@ -487,18 +487,24 @@ static int __init exynos_pcie_probe(struct platform_device *pdev)
 
 	elbi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	exynos_pcie->elbi_base = devm_ioremap_resource(&pdev->dev, elbi_base);
-	if (IS_ERR(exynos_pcie->elbi_base))
-		return PTR_ERR(exynos_pcie->elbi_base);
+	if (IS_ERR(exynos_pcie->elbi_base)) {
+		ret = PTR_ERR(exynos_pcie->elbi_base);
+		goto fail_bus_clk;
+	}
 
 	phy_base = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	exynos_pcie->phy_base = devm_ioremap_resource(&pdev->dev, phy_base);
-	if (IS_ERR(exynos_pcie->phy_base))
-		return PTR_ERR(exynos_pcie->phy_base);
+	if (IS_ERR(exynos_pcie->phy_base)) {
+		ret = PTR_ERR(exynos_pcie->phy_base);
+		goto fail_bus_clk;
+	}
 
 	block_base = platform_get_resource(pdev, IORESOURCE_MEM, 2);
 	exynos_pcie->block_base = devm_ioremap_resource(&pdev->dev, block_base);
-	if (IS_ERR(exynos_pcie->block_base))
-		return PTR_ERR(exynos_pcie->block_base);
+	if (IS_ERR(exynos_pcie->block_base)) {
+		ret = PTR_ERR(exynos_pcie->block_base);
+		goto fail_bus_clk;
+	}
 
 	ret = add_pcie_port(pp, pdev);
 	if (ret < 0)