diff options
author | Mark Brown <broonie@linaro.org> | 2013-08-31 18:55:53 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-18 11:02:47 +0100 |
commit | 91800f0e90050a4db4c77e940796f501e02af8be (patch) | |
tree | e4f1aafdb9bab639d9486717ea1bb1d1eccc2fa4 /drivers/spi/spi-s3c64xx.c | |
parent | fbce71cae72f9f8fd1f2d00e0d47d6cc5f74e2e1 (diff) | |
download | linux-91800f0e90050a4db4c77e940796f501e02af8be.tar.gz linux-91800f0e90050a4db4c77e940796f501e02af8be.tar.bz2 linux-91800f0e90050a4db4c77e940796f501e02af8be.zip |
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.c | 10 |
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) S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN, sdd->regs + S3C64XX_SPI_INT_EN); - if (spi_register_master(master)) { - dev_err(&pdev->dev, "cannot register SPI master\n"); - ret = -EBUSY; + ret = devm_spi_register_master(&pdev->dev, master); + if (ret != 0) { + dev_err(&pdev->dev, "cannot register SPI master: %d\n", ret); goto err3; } @@ -1461,16 +1461,12 @@ static int s3c64xx_spi_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); - spi_unregister_master(master); - writel(0, sdd->regs + S3C64XX_SPI_INT_EN); clk_disable_unprepare(sdd->src_clk); clk_disable_unprepare(sdd->clk); - spi_master_put(master); - return 0; } |