Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: bcm2835: change initialization order and switch to platform_get_irq

Change the initialization order of the HW so that the interrupt
is only requested after the HW is initialized

Also the use of irq_of_parse_and_map is replaced by platform_get_irq.

Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Martin Sperl and committed by
Mark Brown
ddf0e1c2 6ff33f39

+7 -7
+7 -7
drivers/spi/spi-bcm2835.c
··· 777 777 goto out_master_put; 778 778 } 779 779 780 - bs->irq = irq_of_parse_and_map(pdev->dev.of_node, 0); 780 + bs->irq = platform_get_irq(pdev, 0); 781 781 if (bs->irq <= 0) { 782 782 dev_err(&pdev->dev, "could not get IRQ: %d\n", bs->irq); 783 783 err = bs->irq ? bs->irq : -ENODEV; ··· 786 786 787 787 clk_prepare_enable(bs->clk); 788 788 789 + bcm2835_dma_init(master, &pdev->dev); 790 + 791 + /* initialise the hardware with the default polarities */ 792 + bcm2835_wr(bs, BCM2835_SPI_CS, 793 + BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); 794 + 789 795 err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, 0, 790 796 dev_name(&pdev->dev), master); 791 797 if (err) { 792 798 dev_err(&pdev->dev, "could not request IRQ: %d\n", err); 793 799 goto out_clk_disable; 794 800 } 795 - 796 - bcm2835_dma_init(master, &pdev->dev); 797 - 798 - /* initialise the hardware with the default polarities */ 799 - bcm2835_wr(bs, BCM2835_SPI_CS, 800 - BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); 801 801 802 802 err = devm_spi_register_master(&pdev->dev, master); 803 803 if (err) {