aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/langwell_gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/langwell_gpio.c')
-rw-r--r--drivers/gpio/langwell_gpio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/langwell_gpio.c b/drivers/gpio/langwell_gpio.c
index 4baf3d7d0f8e..00c3a14127af 100644
--- a/drivers/gpio/langwell_gpio.c
+++ b/drivers/gpio/langwell_gpio.c
@@ -29,6 +29,7 @@
29#include <linux/irq.h> 29#include <linux/irq.h>
30#include <linux/io.h> 30#include <linux/io.h>
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/slab.h>
32 33
33struct lnw_gpio_register { 34struct lnw_gpio_register {
34 u32 GPLR[2]; 35 u32 GPLR[2];
@@ -123,7 +124,7 @@ static int lnw_irq_type(unsigned irq, unsigned type)
123 void __iomem *grer = (void __iomem *)(&lnw->reg_base->GRER[reg]); 124 void __iomem *grer = (void __iomem *)(&lnw->reg_base->GRER[reg]);
124 void __iomem *gfer = (void __iomem *)(&lnw->reg_base->GFER[reg]); 125 void __iomem *gfer = (void __iomem *)(&lnw->reg_base->GFER[reg]);
125 126
126 if (gpio < 0 || gpio > lnw->chip.ngpio) 127 if (gpio >= lnw->chip.ngpio)
127 return -EINVAL; 128 return -EINVAL;
128 spin_lock_irqsave(&lnw->lock, flags); 129 spin_lock_irqsave(&lnw->lock, flags);
129 if (type & IRQ_TYPE_EDGE_RISING) 130 if (type & IRQ_TYPE_EDGE_RISING)