at86rf230: reset irq line before irq request
authorAlexander Aring <alex.aring@gmail.com>
Thu, 24 Apr 2014 17:09:15 +0000 (19:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 26 Apr 2014 16:20:34 +0000 (12:20 -0400)
This patch resets the irq line before we are requesting the irq. This
avoids pending interrupts before requesting.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ieee802154/at86rf230.c

index 960444b449d9ecfcae06d92886af82bb2f93b00b..994c334fb4f49a23ddb28c6b9fbc2610d9a89f46 100644 (file)
@@ -1172,13 +1172,13 @@ static int at86rf230_probe(struct spi_device *spi)
        if (rc)
                goto err_hw_init;
 
-       rc = devm_request_irq(&spi->dev, spi->irq, irq_handler, IRQF_SHARED,
-                             dev_name(&spi->dev), lp);
+       /* Read irq status register to reset irq line */
+       rc = at86rf230_read_subreg(lp, RG_IRQ_STATUS, 0xff, 0, &status);
        if (rc)
                goto err_hw_init;
 
-       /* Read irq status register to reset irq line */
-       rc = at86rf230_read_subreg(lp, RG_IRQ_STATUS, 0xff, 0, &status);
+       rc = devm_request_irq(&spi->dev, spi->irq, irq_handler, IRQF_SHARED,
+                             dev_name(&spi->dev), lp);
        if (rc)
                goto err_hw_init;