From 59f2189453fc40ba735e0d97eb46785d3cf3e1f7 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Tue, 13 Oct 2009 21:00:51 +0200 Subject: [PATCH] The wrong test was used, gpio is unsigned. Signed-off-by: Roel Kluin Cc: Alek Du Cc: David Brownell Signed-off-by: Andrew Morton --- drivers/gpio/langwell_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/langwell_gpio.c b/drivers/gpio/langwell_gpio.c index 5711ce5353c..7379f8e8215 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) 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) -- 2.11.4.GIT