aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-12-09 05:20:45 -0500
committerMark Brown <broonie@linaro.org>2013-12-17 17:31:39 -0500
commitb1bdd4f883e1938a1921f300d7f164ce583b1a64 (patch)
treea44d13b51cb908335a06bb3caede84cc8fb76f02
parent87917528cc922d0b91643dabacec01415c792086 (diff)
spi: bcm63xx-hsspi: Use devm_clk_get()
Use devm_clk_get() to make cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Jonas Gorski <jogo@openwrt.org> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--drivers/spi/spi-bcm63xx-hsspi.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c
index 2cfe8eb619fd..6a763a8a8a5e 100644
--- a/drivers/spi/spi-bcm63xx-hsspi.c
+++ b/drivers/spi/spi-bcm63xx-hsspi.c
@@ -342,16 +342,14 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
342 if (IS_ERR(regs)) 342 if (IS_ERR(regs))
343 return PTR_ERR(regs); 343 return PTR_ERR(regs);
344 344
345 clk = clk_get(dev, "hsspi"); 345 clk = devm_clk_get(dev, "hsspi");
346 346
347 if (IS_ERR(clk)) 347 if (IS_ERR(clk))
348 return PTR_ERR(clk); 348 return PTR_ERR(clk);
349 349
350 rate = clk_get_rate(clk); 350 rate = clk_get_rate(clk);
351 if (!rate) { 351 if (!rate)
352 ret = -EINVAL; 352 return -EINVAL;
353 goto out_put_clk;
354 }
355 353
356 clk_prepare_enable(clk); 354 clk_prepare_enable(clk);
357 355
@@ -409,9 +407,6 @@ out_put_master:
409 spi_master_put(master); 407 spi_master_put(master);
410out_disable_clk: 408out_disable_clk:
411 clk_disable_unprepare(clk); 409 clk_disable_unprepare(clk);
412out_put_clk:
413 clk_put(clk);
414
415 return ret; 410 return ret;
416} 411}
417 412
@@ -426,7 +421,6 @@ static int bcm63xx_hsspi_remove(struct platform_device *pdev)
426 /* reset the hardware and block queue progress */ 421 /* reset the hardware and block queue progress */
427 __raw_writel(0, bs->regs + HSSPI_INT_MASK_REG); 422 __raw_writel(0, bs->regs + HSSPI_INT_MASK_REG);
428 clk_disable_unprepare(bs->clk); 423 clk_disable_unprepare(bs->clk);
429 clk_put(bs->clk);
430 424
431 return 0; 425 return 0;
432} 426}