aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-12-09 05:20:15 -0500
committerMark Brown <broonie@linaro.org>2013-12-17 17:35:50 -0500
commitacf4fc6ffa84b59e83f34f587be623a05bc0c55c (patch)
treead7d8c9e11410b5ab4acc8bbaa7202d1f080ec0c
parent6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff)
spi: bcm63xx: 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.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index 80d56b214eb5..7b4ead78782c 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -345,22 +345,19 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
345 irq = platform_get_irq(pdev, 0); 345 irq = platform_get_irq(pdev, 0);
346 if (irq < 0) { 346 if (irq < 0) {
347 dev_err(dev, "no irq\n"); 347 dev_err(dev, "no irq\n");
348 ret = -ENXIO; 348 return -ENXIO;
349 goto out;
350 } 349 }
351 350
352 clk = clk_get(dev, "spi"); 351 clk = devm_clk_get(dev, "spi");
353 if (IS_ERR(clk)) { 352 if (IS_ERR(clk)) {
354 dev_err(dev, "no clock for device\n"); 353 dev_err(dev, "no clock for device\n");
355 ret = PTR_ERR(clk); 354 return PTR_ERR(clk);
356 goto out;
357 } 355 }
358 356
359 master = spi_alloc_master(dev, sizeof(*bs)); 357 master = spi_alloc_master(dev, sizeof(*bs));
360 if (!master) { 358 if (!master) {
361 dev_err(dev, "out of memory\n"); 359 dev_err(dev, "out of memory\n");
362 ret = -ENOMEM; 360 return -ENOMEM;
363 goto out_clk;
364 } 361 }
365 362
366 bs = spi_master_get_devdata(master); 363 bs = spi_master_get_devdata(master);
@@ -427,9 +424,6 @@ out_clk_disable:
427 clk_disable_unprepare(clk); 424 clk_disable_unprepare(clk);
428out_err: 425out_err:
429 spi_master_put(master); 426 spi_master_put(master);
430out_clk:
431 clk_put(clk);
432out:
433 return ret; 427 return ret;
434} 428}
435 429
@@ -443,7 +437,6 @@ static int bcm63xx_spi_remove(struct platform_device *pdev)
443 437
444 /* HW shutdown */ 438 /* HW shutdown */
445 clk_disable_unprepare(bs->clk); 439 clk_disable_unprepare(bs->clk);
446 clk_put(bs->clk);
447 440
448 return 0; 441 return 0;
449} 442}