diff options
Diffstat (limited to 'drivers/sh/intc/chip.c')
-rw-r--r-- | drivers/sh/intc/chip.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c index 33b2ed451e0..e0ada377378 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; |