diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-09-24 00:23:00 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-26 06:41:18 -0400 |
commit | 247263dba208fab08c7f49900a9c79adaae1176e (patch) | |
tree | f4bf4eaaaef919c291f5296b8065369989028048 /drivers/spi/spi-bcm2835.c | |
parent | 5afd077d70db464eb780732d40f5240c7dd679ba (diff) |
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/spi/spi-bcm2835.c')
-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 52c81481c5c7..4c332143a310 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) | |||
358 | bcm2835_wr(bs, BCM2835_SPI_CS, | 358 | bcm2835_wr(bs, BCM2835_SPI_CS, |
359 | BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); | 359 | BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); |
360 | 360 | ||
361 | err = spi_register_master(master); | 361 | err = devm_spi_register_master(&pdev->dev, master); |
362 | if (err) { | 362 | if (err) { |
363 | dev_err(&pdev->dev, "could not register SPI master: %d\n", err); | 363 | dev_err(&pdev->dev, "could not register SPI master: %d\n", err); |
364 | goto out_free_irq; | 364 | goto out_free_irq; |
@@ -381,14 +381,12 @@ static int bcm2835_spi_remove(struct platform_device *pdev) | |||
381 | struct bcm2835_spi *bs = spi_master_get_devdata(master); | 381 | struct bcm2835_spi *bs = spi_master_get_devdata(master); |
382 | 382 | ||
383 | free_irq(bs->irq, master); | 383 | free_irq(bs->irq, master); |
384 | spi_unregister_master(master); | ||
385 | 384 | ||
386 | /* Clear FIFOs, and disable the HW block */ | 385 | /* Clear FIFOs, and disable the HW block */ |
387 | bcm2835_wr(bs, BCM2835_SPI_CS, | 386 | bcm2835_wr(bs, BCM2835_SPI_CS, |
388 | BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); | 387 | BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); |
389 | 388 | ||
390 | clk_disable_unprepare(bs->clk); | 389 | clk_disable_unprepare(bs->clk); |
391 | spi_master_put(master); | ||
392 | 390 | ||
393 | return 0; | 391 | return 0; |
394 | } | 392 | } |