mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Cc: Alek Du <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
afd49a7e92
commit
4efec6272e
1 changed files with 1 additions and 1 deletions
|
|
@ -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 *gfer = (void __iomem *)(&lnw->reg_base->GFER[reg]);
|
||||
|
||||
if (gpio < 0 || gpio > lnw->chip.ngpio)
|
||||
if (gpio >= lnw->chip.ngpio)
|
||||
return -EINVAL;
|
||||
spin_lock_irqsave(&lnw->lock, flags);
|
||||
if (type & IRQ_TYPE_EDGE_RISING)
|
||||
|
|
|
|||
Loading…
Reference in a new issue