diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2016-09-13 23:15:57 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-09-14 18:24:47 +0100 |
commit | 35f5d71e38f2c0a9e7fdfbe0e9527efc712cfbcf (patch) | |
tree | da4a98aac981d315099804da6584e0baaeccbd88 /drivers/spi | |
parent | d198ebfb75adec5156b07b96dc21b6b9e5144018 (diff) |
spi: fsl-espi: improve and simplify interrupt handler
Simplify the interrupt handler a little. In addition don't call
fsl_espi_cpu_irq() if no event bit is set.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-fsl-espi.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index 060624f45ce0..032bf3af8388 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -443,17 +443,11 @@ static void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events) ®_base->event)) & SPIE_NF), 1000, 0); if (!ret) { dev_err(mspi->dev, "tired waiting for SPIE_NF\n"); - - /* Clear the SPIE bits */ - mpc8xxx_spi_write_reg(®_base->event, events); complete(&mspi->done); return; } } - /* Clear the events */ - mpc8xxx_spi_write_reg(®_base->event, events); - mspi->count -= 1; if (mspi->count) { u32 word = mspi->get_tx(mspi); @@ -468,19 +462,21 @@ static irqreturn_t fsl_espi_irq(s32 irq, void *context_data) { struct mpc8xxx_spi *mspi = context_data; struct fsl_espi_reg *reg_base = mspi->reg_base; - irqreturn_t ret = IRQ_NONE; u32 events; /* Get interrupt events(tx/rx) */ events = mpc8xxx_spi_read_reg(®_base->event); - if (events) - ret = IRQ_HANDLED; + if (!events) + return IRQ_NONE; dev_vdbg(mspi->dev, "%s: events %x\n", __func__, events); fsl_espi_cpu_irq(mspi, events); - return ret; + /* Clear the events */ + mpc8xxx_spi_write_reg(®_base->event, events); + + return IRQ_HANDLED; } #ifdef CONFIG_PM |