Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189559
b: refs/heads/master
c: 2a48180
h: refs/heads/master
i:
  189557: 4c20720
  189555: c7b3e52
  189551: 7cd23ed
v: v3
  • Loading branch information
Julia Lawall authored and Linus Torvalds committed Apr 7, 2010
1 parent 093d291 commit ec818d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c70c036f04b7b74282477d6a51bbcc8bb8897e03
refs/heads/master: 2a481800caf78f4750cc673c8baed12b5d703ff6
12 changes: 8 additions & 4 deletions trunk/drivers/gpio/timbgpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ static int timbgpio_irq_type(unsigned irq, unsigned trigger)
unsigned long flags;
u32 lvr, flr, bflr = 0;
u32 ver;
int ret = 0;

if (offset < 0 || offset > tgpio->gpio.ngpio)
return -EINVAL;
Expand All @@ -154,8 +155,10 @@ static int timbgpio_irq_type(unsigned irq, unsigned trigger)
}

if ((trigger & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) {
if (ver < 3)
return -EINVAL;
if (ver < 3) {
ret = -EINVAL;
goto out;
}
else {
flr |= 1 << offset;
bflr |= 1 << offset;
Expand All @@ -175,9 +178,10 @@ static int timbgpio_irq_type(unsigned irq, unsigned trigger)
iowrite32(bflr, tgpio->membase + TGPIO_BFLR);

iowrite32(1 << offset, tgpio->membase + TGPIO_ICR);
spin_unlock_irqrestore(&tgpio->lock, flags);

return 0;
out:
spin_unlock_irqrestore(&tgpio->lock, flags);
return ret;
}

static void timbgpio_irq(unsigned int irq, struct irq_desc *desc)
Expand Down

0 comments on commit ec818d5

Please sign in to comment.