Skip to contentSkip to conversation

fpga: zynq-fpga: Fix unbalanced clock handling

PATCH Superseded Moritz Fischer 1 participant 2 messages Oct 19, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fpga: zynq-fpga: Fix unbalanced clock handling

This commit fixes the unbalanced clock handling, where a failed probe would leave the clock with a prepare count of -1.

---
 drivers/fpga/zynq-fpga.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/fpga/zynq-fpga.c +2 -2
index 103303c..617d382 100644
@@ -487,7 +487,7 @@ static int zynq_fpga_probe(struct platform_device *pdev)
 				&zynq_fpga_ops, priv);
 	if (err) {
 		dev_err(dev, "unable to register FPGA manager");
-		clk_disable_unprepare(priv->clk);
+		clk_unprepare(priv->clk);
 		return err;
 	}
 
@@ -502,7 +502,7 @@ static int zynq_fpga_remove(struct platform_device *pdev)
 
 	priv = platform_get_drvdata(pdev);
 
-	clk_disable_unprepare(priv->clk);
+	clk_unprepare(priv->clk);
 
 	return 0;
 }
Signature · 1 line
2.6.1
#1 lore raw
Quoted 2 lines · Moritz Fischer

This commit fixes the unbalanced clock handling, where a failed probe would leave the clock with a prepare count of -1.

My English is broken, and it should've said enable count, will resubmit ... Sorry for the noise

Quoted 30 lines
---
 drivers/fpga/zynq-fpga.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/fpga/zynq-fpga.c +2 -3
index 103303c..617d382 100644
@@ -487,7 +487,7 @@ static int zynq_fpga_probe(struct platform_device *pdev)
                                &zynq_fpga_ops, priv);
        if (err) {
                dev_err(dev, "unable to register FPGA manager");
-               clk_disable_unprepare(priv->clk);
+               clk_unprepare(priv->clk);
                return err;
        }
 
@@ -502,7 +502,7 @@ static int zynq_fpga_remove(struct platform_device *pdev)
 
        priv = platform_get_drvdata(pdev);
 
-       clk_disable_unprepare(priv->clk);
+       clk_unprepare(priv->clk);
 
        return 0;
 }
--
Quoted 2 lines

2.6.1

Moritz