diff options
Diffstat (limited to 'drivers/spi/spi-ath79.c')
-rw-r--r-- | drivers/spi/spi-ath79.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/spi/spi-ath79.c b/drivers/spi/spi-ath79.c index 821bf7ac218d..31534b51715a 100644 --- a/drivers/spi/spi-ath79.c +++ b/drivers/spi/spi-ath79.c | |||
@@ -243,21 +243,21 @@ static int ath79_spi_probe(struct platform_device *pdev) | |||
243 | goto err_put_master; | 243 | goto err_put_master; |
244 | } | 244 | } |
245 | 245 | ||
246 | sp->base = ioremap(r->start, resource_size(r)); | 246 | sp->base = devm_ioremap(&pdev->dev, r->start, resource_size(r)); |
247 | if (!sp->base) { | 247 | if (!sp->base) { |
248 | ret = -ENXIO; | 248 | ret = -ENXIO; |
249 | goto err_put_master; | 249 | goto err_put_master; |
250 | } | 250 | } |
251 | 251 | ||
252 | sp->clk = clk_get(&pdev->dev, "ahb"); | 252 | sp->clk = devm_clk_get(&pdev->dev, "ahb"); |
253 | if (IS_ERR(sp->clk)) { | 253 | if (IS_ERR(sp->clk)) { |
254 | ret = PTR_ERR(sp->clk); | 254 | ret = PTR_ERR(sp->clk); |
255 | goto err_unmap; | 255 | goto err_put_master; |
256 | } | 256 | } |
257 | 257 | ||
258 | ret = clk_enable(sp->clk); | 258 | ret = clk_enable(sp->clk); |
259 | if (ret) | 259 | if (ret) |
260 | goto err_clk_put; | 260 | goto err_put_master; |
261 | 261 | ||
262 | rate = DIV_ROUND_UP(clk_get_rate(sp->clk), MHZ); | 262 | rate = DIV_ROUND_UP(clk_get_rate(sp->clk), MHZ); |
263 | if (!rate) { | 263 | if (!rate) { |
@@ -280,10 +280,6 @@ err_disable: | |||
280 | ath79_spi_disable(sp); | 280 | ath79_spi_disable(sp); |
281 | err_clk_disable: | 281 | err_clk_disable: |
282 | clk_disable(sp->clk); | 282 | clk_disable(sp->clk); |
283 | err_clk_put: | ||
284 | clk_put(sp->clk); | ||
285 | err_unmap: | ||
286 | iounmap(sp->base); | ||
287 | err_put_master: | 283 | err_put_master: |
288 | spi_master_put(sp->bitbang.master); | 284 | spi_master_put(sp->bitbang.master); |
289 | 285 | ||
@@ -297,8 +293,6 @@ static int ath79_spi_remove(struct platform_device *pdev) | |||
297 | spi_bitbang_stop(&sp->bitbang); | 293 | spi_bitbang_stop(&sp->bitbang); |
298 | ath79_spi_disable(sp); | 294 | ath79_spi_disable(sp); |
299 | clk_disable(sp->clk); | 295 | clk_disable(sp->clk); |
300 | clk_put(sp->clk); | ||
301 | iounmap(sp->base); | ||
302 | spi_master_put(sp->bitbang.master); | 296 | spi_master_put(sp->bitbang.master); |
303 | 297 | ||
304 | return 0; | 298 | return 0; |