summaryrefslogtreecommitdiffstats
path: root/drivers/irqchip/irq-atmel-aic-common.c
diff options
context:
space:
mode:
authorGavin Li <git@thegavinli.com>2015-01-07 03:47:23 +0100
committerJason Cooper <jason@lakedaemon.net>2015-01-07 13:41:45 +0100
commit91d1179212161f220938198b742c328ad38fd0a3 (patch)
tree7852017c864f0eb3833782e2a017952bd8531458 /drivers/irqchip/irq-atmel-aic-common.c
parentirqchip: omap-intc: Fix legacy DMA regression (diff)
downloadlinux-91d1179212161f220938198b742c328ad38fd0a3.tar.xz
linux-91d1179212161f220938198b742c328ad38fd0a3.zip
irqchip: atmel-aic-common: Prevent clobbering of priority when changing IRQ type
This patch makes the bitmask for AIC_SRCTYPE consistent with that of its valid values, and prevents the priority field at bits 2:0 from being clobbered by an incorrect AND with the AIC_SRCTYPE mask. Signed-off-by: Gavin Li <gavinli@thegavinli.com> Cc: <stable@vger.kernel.org> # v3.17+ Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Link: https://lkml.kernel.org/r/1420598843-8409-1-git-send-email-gavinli@thegavinli.com Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'drivers/irqchip/irq-atmel-aic-common.c')
-rw-r--r--drivers/irqchip/irq-atmel-aic-common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c
index d111ac779c40..63cd031b2c28 100644
--- a/drivers/irqchip/irq-atmel-aic-common.c
+++ b/drivers/irqchip/irq-atmel-aic-common.c
@@ -28,7 +28,7 @@
#define AT91_AIC_IRQ_MIN_PRIORITY 0
#define AT91_AIC_IRQ_MAX_PRIORITY 7
-#define AT91_AIC_SRCTYPE GENMASK(7, 6)
+#define AT91_AIC_SRCTYPE GENMASK(6, 5)
#define AT91_AIC_SRCTYPE_LOW (0 << 5)
#define AT91_AIC_SRCTYPE_FALLING (1 << 5)
#define AT91_AIC_SRCTYPE_HIGH (2 << 5)
@@ -74,7 +74,7 @@ int aic_common_set_type(struct irq_data *d, unsigned type, unsigned *val)
return -EINVAL;
}
- *val &= AT91_AIC_SRCTYPE;
+ *val &= ~AT91_AIC_SRCTYPE;
*val |= aic_type;
return 0;