summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-12-09 10:39:13 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-12-09 20:25:19 +0000
commit89a5c985f81a0b60f7522044938f76caf28075a6 (patch)
treef83dec234936ef6113ea2dfe2dd725a3dd1c382c /drivers
parent26825cfd90f94f47068519901b3670ae7da320fe (diff)
downloadlinux-89a5c985f81a0b60f7522044938f76caf28075a6.tar.bz2
ARM: 7915/1: amba: Convert to clk_prepare_enable and clk_disable_unprepare
To simplify code and error handling let's use clk_prepare_enable and clk_disable_unprepare. No functional change. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/amba/bus.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index b90dc1ec109d..ea1d8357f298 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -151,36 +151,23 @@ postcore_initcall(amba_init);
static int amba_get_enable_pclk(struct amba_device *pcdev)
{
- struct clk *pclk = clk_get(&pcdev->dev, "apb_pclk");
int ret;
- pcdev->pclk = pclk;
+ pcdev->pclk = clk_get(&pcdev->dev, "apb_pclk");
+ if (IS_ERR(pcdev->pclk))
+ return PTR_ERR(pcdev->pclk);
- 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) {
- clk_unprepare(pclk);
- clk_put(pclk);
- }
+ ret = clk_prepare_enable(pcdev->pclk);
+ if (ret)
+ clk_put(pcdev->pclk);
return ret;
}
static void amba_put_disable_pclk(struct amba_device *pcdev)
{
- struct clk *pclk = pcdev->pclk;
-
- clk_disable(pclk);
- clk_unprepare(pclk);
- clk_put(pclk);
+ clk_disable_unprepare(pcdev->pclk);
+ clk_put(pcdev->pclk);
}
/*