aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh/intc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sh/intc')
-rw-r--r--drivers/sh/intc/chip.c9
-rw-r--r--drivers/sh/intc/userimask.c1
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c
index 33b2ed451e09..e0ada3773786 100644
--- a/drivers/sh/intc/chip.c
+++ b/drivers/sh/intc/chip.c
@@ -202,11 +202,16 @@ static int intc_set_type(struct irq_data *data, unsigned int type)
202 if (!value) 202 if (!value)
203 return -EINVAL; 203 return -EINVAL;
204 204
205 value &= ~SENSE_VALID_FLAG;
206
205 ihp = intc_find_irq(d->sense, d->nr_sense, irq); 207 ihp = intc_find_irq(d->sense, d->nr_sense, irq);
206 if (ihp) { 208 if (ihp) {
209 /* PINT has 2-bit sense registers, should fail on EDGE_BOTH */
210 if (value >= (1 << _INTC_WIDTH(ihp->handle)))
211 return -EINVAL;
212
207 addr = INTC_REG(d, _INTC_ADDR_E(ihp->handle), 0); 213 addr = INTC_REG(d, _INTC_ADDR_E(ihp->handle), 0);
208 intc_reg_fns[_INTC_FN(ihp->handle)](addr, ihp->handle, 214 intc_reg_fns[_INTC_FN(ihp->handle)](addr, ihp->handle, value);
209 value & ~SENSE_VALID_FLAG);
210 } 215 }
211 216
212 return 0; 217 return 0;
diff --git a/drivers/sh/intc/userimask.c b/drivers/sh/intc/userimask.c
index e32304b66cf1..56bf9336b92b 100644
--- a/drivers/sh/intc/userimask.c
+++ b/drivers/sh/intc/userimask.c
@@ -13,6 +13,7 @@
13#include <linux/sysdev.h> 13#include <linux/sysdev.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/stat.h>
16#include <asm/sizes.h> 17#include <asm/sizes.h>
17#include "internals.h" 18#include "internals.h"
18 19