Commit 4efec627 authored by Roel Kluin's avatar Roel Kluin Committed by Linus Torvalds

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: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Alek Du <alek.du@intel.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent afd49a7e
...@@ -123,7 +123,7 @@ static int lnw_irq_type(unsigned irq, unsigned type) ...@@ -123,7 +123,7 @@ static int lnw_irq_type(unsigned irq, unsigned type)
void __iomem *grer = (void __iomem *)(&lnw->reg_base->GRER[reg]); void __iomem *grer = (void __iomem *)(&lnw->reg_base->GRER[reg]);
void __iomem *gfer = (void __iomem *)(&lnw->reg_base->GFER[reg]); void __iomem *gfer = (void __iomem *)(&lnw->reg_base->GFER[reg]);
if (gpio < 0 || gpio > lnw->chip.ngpio) if (gpio >= lnw->chip.ngpio)
return -EINVAL; return -EINVAL;
spin_lock_irqsave(&lnw->lock, flags); spin_lock_irqsave(&lnw->lock, flags);
if (type & IRQ_TYPE_EDGE_RISING) if (type & IRQ_TYPE_EDGE_RISING)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment