diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2014-02-04 10:58:50 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-04 14:17:56 -0500 |
commit | 6cac167b826eced25a2756b996a93c6f7833c49b (patch) | |
tree | 8cacbb133da333e867e80ad5604c633ef04a203a | |
parent | 3e7dde425dbcc7965398e92909d898c4ebc9fdb8 (diff) |
spi: pl022: Simplify clock handling
Make use of clk_prepare_enable and clk_disable_unprepare to simplify
code. No functional change.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/spi/spi-pl022.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 4ec49eae6141..5f7594bc2086 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c | |||
@@ -2183,13 +2183,7 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id) | |||
2183 | goto err_no_clk; | 2183 | goto err_no_clk; |
2184 | } | 2184 | } |
2185 | 2185 | ||
2186 | status = clk_prepare(pl022->clk); | 2186 | status = clk_prepare_enable(pl022->clk); |
2187 | if (status) { | ||
2188 | dev_err(&adev->dev, "could not prepare SSP/SPI bus clock\n"); | ||
2189 | goto err_clk_prep; | ||
2190 | } | ||
2191 | |||
2192 | status = clk_enable(pl022->clk); | ||
2193 | if (status) { | 2187 | if (status) { |
2194 | dev_err(&adev->dev, "could not enable SSP/SPI bus clock\n"); | 2188 | dev_err(&adev->dev, "could not enable SSP/SPI bus clock\n"); |
2195 | goto err_no_clk_en; | 2189 | goto err_no_clk_en; |
@@ -2250,10 +2244,8 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id) | |||
2250 | if (platform_info->enable_dma) | 2244 | if (platform_info->enable_dma) |
2251 | pl022_dma_remove(pl022); | 2245 | pl022_dma_remove(pl022); |
2252 | err_no_irq: | 2246 | err_no_irq: |
2253 | clk_disable(pl022->clk); | 2247 | clk_disable_unprepare(pl022->clk); |
2254 | err_no_clk_en: | 2248 | err_no_clk_en: |
2255 | clk_unprepare(pl022->clk); | ||
2256 | err_clk_prep: | ||
2257 | err_no_clk: | 2249 | err_no_clk: |
2258 | err_no_ioremap: | 2250 | err_no_ioremap: |
2259 | amba_release_regions(adev); | 2251 | amba_release_regions(adev); |
@@ -2281,8 +2273,7 @@ pl022_remove(struct amba_device *adev) | |||
2281 | if (pl022->master_info->enable_dma) | 2273 | if (pl022->master_info->enable_dma) |
2282 | pl022_dma_remove(pl022); | 2274 | pl022_dma_remove(pl022); |
2283 | 2275 | ||
2284 | clk_disable(pl022->clk); | 2276 | clk_disable_unprepare(pl022->clk); |
2285 | clk_unprepare(pl022->clk); | ||
2286 | amba_release_regions(adev); | 2277 | amba_release_regions(adev); |
2287 | tasklet_disable(&pl022->pump_transfers); | 2278 | tasklet_disable(&pl022->pump_transfers); |
2288 | return 0; | 2279 | return 0; |