aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-s3c64xx.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-31 13:55:53 -0400
committerMark Brown <broonie@linaro.org>2013-09-18 06:02:47 -0400
commit91800f0e90050a4db4c77e940796f501e02af8be (patch)
treee4f1aafdb9bab639d9486717ea1bb1d1eccc2fa4 /drivers/spi/spi-s3c64xx.c
parentfbce71cae72f9f8fd1f2d00e0d47d6cc5f74e2e1 (diff)
spi/s3c64xx: Use managed registration
Also improve the error reporting on failure and remove a duplicate put. This provides a small code saving. Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-s3c64xx.c')
-rw-r--r--drivers/spi/spi-s3c64xx.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 20dd71237d3b..8bed27a4108c 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1428,9 +1428,9 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
1428 S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN, 1428 S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN,
1429 sdd->regs + S3C64XX_SPI_INT_EN); 1429 sdd->regs + S3C64XX_SPI_INT_EN);
1430 1430
1431 if (spi_register_master(master)) { 1431 ret = devm_spi_register_master(&pdev->dev, master);
1432 dev_err(&pdev->dev, "cannot register SPI master\n"); 1432 if (ret != 0) {
1433 ret = -EBUSY; 1433 dev_err(&pdev->dev, "cannot register SPI master: %d\n", ret);
1434 goto err3; 1434 goto err3;
1435 } 1435 }
1436 1436
@@ -1461,16 +1461,12 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
1461 1461
1462 pm_runtime_disable(&pdev->dev); 1462 pm_runtime_disable(&pdev->dev);
1463 1463
1464 spi_unregister_master(master);
1465
1466 writel(0, sdd->regs + S3C64XX_SPI_INT_EN); 1464 writel(0, sdd->regs + S3C64XX_SPI_INT_EN);
1467 1465
1468 clk_disable_unprepare(sdd->src_clk); 1466 clk_disable_unprepare(sdd->src_clk);
1469 1467
1470 clk_disable_unprepare(sdd->clk); 1468 clk_disable_unprepare(sdd->clk);
1471 1469
1472 spi_master_put(master);
1473
1474 return 0; 1470 return 0;
1475} 1471}
1476 1472