* [PATCH] PCI: rcar: Don't disable/unprepare clocks on prepare/enable failure
@ 2016-08-31 9:28 Geert Uytterhoeven
2016-09-12 22:15 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2016-08-31 9:28 UTC (permalink / raw)
To: Bjorn Helgaas, Simon Horman, Phil Edworthy
Cc: linux-pci, linux-renesas-soc, Geert Uytterhoeven
If clk_prepare_enable() fails, we must not call clk_disable_unprepare()
in the error path.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/pci/host/pcie-rcar.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index 65db7a2215090ff4..0f5c2b2b4f8dfcd2 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -782,7 +782,7 @@ static int rcar_pcie_get_resources(struct platform_device *pdev,
}
err = clk_prepare_enable(pcie->clk);
if (err)
- goto fail_clk;
+ return err;
pcie->bus_clk = devm_clk_get(&pdev->dev, "pcie_bus");
if (IS_ERR(pcie->bus_clk)) {
@@ -792,7 +792,7 @@ static int rcar_pcie_get_resources(struct platform_device *pdev,
}
err = clk_prepare_enable(pcie->bus_clk);
if (err)
- goto err_map_reg;
+ goto fail_clk;
i = irq_of_parse_and_map(pdev->dev.of_node, 0);
if (!i) {
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: rcar: Don't disable/unprepare clocks on prepare/enable failure
2016-08-31 9:28 [PATCH] PCI: rcar: Don't disable/unprepare clocks on prepare/enable failure Geert Uytterhoeven
@ 2016-09-12 22:15 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2016-09-12 22:15 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Bjorn Helgaas, Simon Horman, Phil Edworthy, linux-pci,
linux-renesas-soc
On Wed, Aug 31, 2016 at 11:28:22AM +0200, Geert Uytterhoeven wrote:
> If clk_prepare_enable() fails, we must not call clk_disable_unprepare()
> in the error path.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Applied to pci/host-rcar for v4.9, thanks!
> ---
> drivers/pci/host/pcie-rcar.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> index 65db7a2215090ff4..0f5c2b2b4f8dfcd2 100644
> --- a/drivers/pci/host/pcie-rcar.c
> +++ b/drivers/pci/host/pcie-rcar.c
> @@ -782,7 +782,7 @@ static int rcar_pcie_get_resources(struct platform_device *pdev,
> }
> err = clk_prepare_enable(pcie->clk);
> if (err)
> - goto fail_clk;
> + return err;
>
> pcie->bus_clk = devm_clk_get(&pdev->dev, "pcie_bus");
> if (IS_ERR(pcie->bus_clk)) {
> @@ -792,7 +792,7 @@ static int rcar_pcie_get_resources(struct platform_device *pdev,
> }
> err = clk_prepare_enable(pcie->bus_clk);
> if (err)
> - goto err_map_reg;
> + goto fail_clk;
>
> i = irq_of_parse_and_map(pdev->dev.of_node, 0);
> if (!i) {
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-12 22:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-31 9:28 [PATCH] PCI: rcar: Don't disable/unprepare clocks on prepare/enable failure Geert Uytterhoeven
2016-09-12 22:15 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).