]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/amba/bus.c
Merge branch 'x86-geode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / drivers / amba / bus.c
index 84bdaace56c86856422c0b48640c2ae3a4c519ce..bd230e8011311c3298492018617853672016b86d 100644 (file)
@@ -460,9 +460,17 @@ static int amba_get_enable_pclk(struct amba_device *pcdev)
        if (IS_ERR(pclk))
                return PTR_ERR(pclk);
 
+       ret = clk_prepare(pclk);
+       if (ret) {
+               clk_put(pclk);
+               return ret;
+       }
+
        ret = clk_enable(pclk);
-       if (ret)
+       if (ret) {
+               clk_unprepare(pclk);
                clk_put(pclk);
+       }
 
        return ret;
 }
@@ -472,6 +480,7 @@ static void amba_put_disable_pclk(struct amba_device *pcdev)
        struct clk *pclk = pcdev->pclk;
 
        clk_disable(pclk);
+       clk_unprepare(pclk);
        clk_put(pclk);
 }