Merge tag 'spi-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
[linux-2.6-microblaze.git] / drivers / spi / spi-bcm2835.c
index 0933948..747e032 100644 (file)
@@ -372,6 +372,10 @@ static irqreturn_t bcm2835_spi_interrupt(int irq, void *dev_id)
        struct bcm2835_spi *bs = dev_id;
        u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS);
 
+       /* Bail out early if interrupts are not enabled */
+       if (!(cs & BCM2835_SPI_CS_INTR))
+               return IRQ_NONE;
+
        /*
         * An interrupt is signaled either if DONE is set (TX FIFO empty)
         * or if RXR is set (RX FIFO >= ¾ full).
@@ -1369,8 +1373,8 @@ 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 = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, 0,
-                              dev_name(&pdev->dev), bs);
+       err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt,
+                              IRQF_SHARED, dev_name(&pdev->dev), bs);
        if (err) {
                dev_err(&pdev->dev, "could not request IRQ: %d\n", err);
                goto out_dma_release;