[ARM] 5108/2: PXA SSP: Don't unconditionally free interrupt
authorMark Brown <broonie@sirena.org.uk>
Thu, 19 Jun 2008 02:18:09 +0000 (03:18 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 10 Jul 2008 16:07:36 +0000 (17:07 +0100)
Callers may stop the SSP core requesting the interrupt so it can't be
freed unconditionally.  Also use NO_IRQ like we should.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-pxa/ssp.c

index 00af7f2fed66e5e865c4262b0a58313ab251fd2e..363668cc3a9c57d0e726316ecd2ba2f666c07b48 100644 (file)
@@ -285,7 +285,7 @@ int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags)
                        goto out_region;
                dev->irq = ssp->irq;
        } else
-               dev->irq = 0;
+               dev->irq = NO_IRQ;
 
        /* turn on SSP port clock */
        clk_enable(ssp->clk);
@@ -306,7 +306,8 @@ void ssp_exit(struct ssp_dev *dev)
        struct ssp_device *ssp = dev->ssp;
 
        ssp_disable(dev);
-       free_irq(dev->irq, dev);
+       if (dev->irq != NO_IRQ)
+               free_irq(dev->irq, dev);
        clk_disable(ssp->clk);
        ssp_free(ssp);
 }