diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-09-24 04:23:00 (GMT) |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-26 10:41:18 (GMT) |
commit | 247263dba208fab08c7f49900a9c79adaae1176e (patch) | |
tree | f4bf4eaaaef919c291f5296b8065369989028048 /drivers | |
parent | 5afd077d70db464eb780732d40f5240c7dd679ba (diff) | |
download | linux-247263dba208fab08c7f49900a9c79adaae1176e.tar.xz |
spi: bcm2835: use devm_spi_register_master()
Use devm_spi_register_master() to make cleanup paths simpler,
and remove a duplicate put.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/spi-bcm2835.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 52c8148..4c332143 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -358,7 +358,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev) bcm2835_wr(bs, BCM2835_SPI_CS, BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); - err = spi_register_master(master); + err = devm_spi_register_master(&pdev->dev, master); if (err) { dev_err(&pdev->dev, "could not register SPI master: %d\n", err); goto out_free_irq; @@ -381,14 +381,12 @@ static int bcm2835_spi_remove(struct platform_device *pdev) struct bcm2835_spi *bs = spi_master_get_devdata(master); free_irq(bs->irq, master); - spi_unregister_master(master); /* Clear FIFOs, and disable the HW block */ bcm2835_wr(bs, BCM2835_SPI_CS, BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); clk_disable_unprepare(bs->clk); - spi_master_put(master); return 0; } |