Commit 08bc0544 authored by Jingoo Han's avatar Jingoo Han Committed by Mark Brown

spi: bcm2835: Use devm_request_irq()

Use devm_request_irq() to make cleanup paths simpler.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 374b1057
...@@ -347,8 +347,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev) ...@@ -347,8 +347,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
clk_prepare_enable(bs->clk); clk_prepare_enable(bs->clk);
err = request_irq(bs->irq, bcm2835_spi_interrupt, 0, err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, 0,
dev_name(&pdev->dev), master); dev_name(&pdev->dev), master);
if (err) { if (err) {
dev_err(&pdev->dev, "could not request IRQ: %d\n", err); dev_err(&pdev->dev, "could not request IRQ: %d\n", err);
goto out_clk_disable; goto out_clk_disable;
...@@ -361,13 +361,11 @@ static int bcm2835_spi_probe(struct platform_device *pdev) ...@@ -361,13 +361,11 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
err = devm_spi_register_master(&pdev->dev, master); err = devm_spi_register_master(&pdev->dev, master);
if (err) { if (err) {
dev_err(&pdev->dev, "could not register SPI master: %d\n", err); dev_err(&pdev->dev, "could not register SPI master: %d\n", err);
goto out_free_irq; goto out_clk_disable;
} }
return 0; return 0;
out_free_irq:
free_irq(bs->irq, master);
out_clk_disable: out_clk_disable:
clk_disable_unprepare(bs->clk); clk_disable_unprepare(bs->clk);
out_master_put: out_master_put:
...@@ -380,8 +378,6 @@ static int bcm2835_spi_remove(struct platform_device *pdev) ...@@ -380,8 +378,6 @@ static int bcm2835_spi_remove(struct platform_device *pdev)
struct spi_master *master = platform_get_drvdata(pdev); struct spi_master *master = platform_get_drvdata(pdev);
struct bcm2835_spi *bs = spi_master_get_devdata(master); struct bcm2835_spi *bs = spi_master_get_devdata(master);
free_irq(bs->irq, master);
/* Clear FIFOs, and disable the HW block */ /* Clear FIFOs, and disable the HW block */
bcm2835_wr(bs, BCM2835_SPI_CS, bcm2835_wr(bs, BCM2835_SPI_CS,
BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment