aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-bcm2835.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spi-bcm2835.c')
-rw-r--r--drivers/spi/spi-bcm2835.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 9025edd7dc45..8a89dd1f2654 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -347,8 +347,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
347 347
348 clk_prepare_enable(bs->clk); 348 clk_prepare_enable(bs->clk);
349 349
350 err = request_irq(bs->irq, bcm2835_spi_interrupt, 0, 350 err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, 0,
351 dev_name(&pdev->dev), master); 351 dev_name(&pdev->dev), master);
352 if (err) { 352 if (err) {
353 dev_err(&pdev->dev, "could not request IRQ: %d\n", err); 353 dev_err(&pdev->dev, "could not request IRQ: %d\n", err);
354 goto out_clk_disable; 354 goto out_clk_disable;
@@ -361,13 +361,11 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
361 err = devm_spi_register_master(&pdev->dev, 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_clk_disable;
365 } 365 }
366 366
367 return 0; 367 return 0;
368 368
369out_free_irq:
370 free_irq(bs->irq, master);
371out_clk_disable: 369out_clk_disable:
372 clk_disable_unprepare(bs->clk); 370 clk_disable_unprepare(bs->clk);
373out_master_put: 371out_master_put:
@@ -380,8 +378,6 @@ static int bcm2835_spi_remove(struct platform_device *pdev)
380 struct spi_master *master = platform_get_drvdata(pdev); 378 struct spi_master *master = platform_get_drvdata(pdev);
381 struct bcm2835_spi *bs = spi_master_get_devdata(master); 379 struct bcm2835_spi *bs = spi_master_get_devdata(master);
382 380
383 free_irq(bs->irq, master);
384
385 /* Clear FIFOs, and disable the HW block */ 381 /* Clear FIFOs, and disable the HW block */
386 bcm2835_wr(bs, BCM2835_SPI_CS, 382 bcm2835_wr(bs, BCM2835_SPI_CS,
387 BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); 383 BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);