aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/amba/bus.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-12-09 04:39:13 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-12-09 15:25:19 -0500
commit89a5c985f81a0b60f7522044938f76caf28075a6 (patch)
treef83dec234936ef6113ea2dfe2dd725a3dd1c382c /drivers/amba/bus.c
parent26825cfd90f94f47068519901b3670ae7da320fe (diff)
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/amba/bus.c')
-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);
151 151
152static int amba_get_enable_pclk(struct amba_device *pcdev) 152static int amba_get_enable_pclk(struct amba_device *pcdev)
153{ 153{
154 struct clk *pclk = clk_get(&pcdev->dev, "apb_pclk");
155 int ret; 154 int ret;
156 155
157 pcdev->pclk = pclk; 156 pcdev->pclk = clk_get(&pcdev->dev, "apb_pclk");
157 if (IS_ERR(pcdev->pclk))
158 return PTR_ERR(pcdev->pclk);
158 159
159 if (IS_ERR(pclk)) 160 ret = clk_prepare_enable(pcdev->pclk);
160 return PTR_ERR(pclk); 161 if (ret)
161 162 clk_put(pcdev->pclk);
162 ret = clk_prepare(pclk);
163 if (ret) {
164 clk_put(pclk);
165 return ret;
166 }
167
168 ret = clk_enable(pclk);
169 if (ret) {
170 clk_unprepare(pclk);
171 clk_put(pclk);
172 }
173 163
174 return ret; 164 return ret;
175} 165}
176 166
177static void amba_put_disable_pclk(struct amba_device *pcdev) 167static void amba_put_disable_pclk(struct amba_device *pcdev)
178{ 168{
179 struct clk *pclk = pcdev->pclk; 169 clk_disable_unprepare(pcdev->pclk);
180 170 clk_put(pcdev->pclk);
181 clk_disable(pclk);
182 clk_unprepare(pclk);
183 clk_put(pclk);
184} 171}
185 172
186/* 173/*