diff options
Diffstat (limited to 'drivers/amba')
-rw-r--r-- | drivers/amba/bus.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 84bdaace56c8..bd230e801131 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c | |||
@@ -460,9 +460,17 @@ static int amba_get_enable_pclk(struct amba_device *pcdev) | |||
460 | if (IS_ERR(pclk)) | 460 | if (IS_ERR(pclk)) |
461 | return PTR_ERR(pclk); | 461 | return PTR_ERR(pclk); |
462 | 462 | ||
463 | ret = clk_prepare(pclk); | ||
464 | if (ret) { | ||
465 | clk_put(pclk); | ||
466 | return ret; | ||
467 | } | ||
468 | |||
463 | ret = clk_enable(pclk); | 469 | ret = clk_enable(pclk); |
464 | if (ret) | 470 | if (ret) { |
471 | clk_unprepare(pclk); | ||
465 | clk_put(pclk); | 472 | clk_put(pclk); |
473 | } | ||
466 | 474 | ||
467 | return ret; | 475 | return ret; |
468 | } | 476 | } |
@@ -472,6 +480,7 @@ static void amba_put_disable_pclk(struct amba_device *pcdev) | |||
472 | struct clk *pclk = pcdev->pclk; | 480 | struct clk *pclk = pcdev->pclk; |
473 | 481 | ||
474 | clk_disable(pclk); | 482 | clk_disable(pclk); |
483 | clk_unprepare(pclk); | ||
475 | clk_put(pclk); | 484 | clk_put(pclk); |
476 | } | 485 | } |
477 | 486 | ||