aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-12-15 19:46:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 10:20:00 -0500
commit4efec6272e8e61fc77132b4d2bae56d61b289956 (patch)
tree18d7677a8f490f1732da82a99912c042979b29ae /drivers/gpio
parentafd49a7e92851239c3edffae730cc27080bfab78 (diff)
gpio: fix test on unsigned in lnw_irq_type()
The wrong test was used, gpio is unsigned and it had an off-by-one. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Alek Du <alek.du@intel.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/langwell_gpio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/langwell_gpio.c b/drivers/gpio/langwell_gpio.c
index 4baf3d7d0f8e..6c0ebbdc659e 100644
--- a/drivers/gpio/langwell_gpio.c
+++ b/drivers/gpio/langwell_gpio.c
@@ -123,7 +123,7 @@ static int lnw_irq_type(unsigned irq, unsigned type)
123 void __iomem *grer = (void __iomem *)(&lnw->reg_base->GRER[reg]); 123 void __iomem *grer = (void __iomem *)(&lnw->reg_base->GRER[reg]);
124 void __iomem *gfer = (void __iomem *)(&lnw->reg_base->GFER[reg]); 124 void __iomem *gfer = (void __iomem *)(&lnw->reg_base->GFER[reg]);
125 125
126 if (gpio < 0 || gpio > lnw->chip.ngpio) 126 if (gpio >= lnw->chip.ngpio)
127 return -EINVAL; 127 return -EINVAL;
128 spin_lock_irqsave(&lnw->lock, flags); 128 spin_lock_irqsave(&lnw->lock, flags);
129 if (type & IRQ_TYPE_EDGE_RISING) 129 if (type & IRQ_TYPE_EDGE_RISING)