浏览代码

gpio: pl061: remove range check

The gpiochip calls are already checking that the GPIO line
offsets are in range.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij 9 年之前
父节点
当前提交
682366d5c9
共有 1 个文件被更改,包括 0 次插入6 次删除
  1. 0 6
      drivers/gpio/gpio-pl061.c

+ 0 - 6
drivers/gpio/gpio-pl061.c

@@ -67,9 +67,6 @@ static int pl061_direction_input(struct gpio_chip *gc, unsigned offset)
 	unsigned long flags;
 	unsigned char gpiodir;
 
-	if (offset >= gc->ngpio)
-		return -EINVAL;
-
 	spin_lock_irqsave(&chip->lock, flags);
 	gpiodir = readb(chip->base + GPIODIR);
 	gpiodir &= ~(BIT(offset));
@@ -86,9 +83,6 @@ static int pl061_direction_output(struct gpio_chip *gc, unsigned offset,
 	unsigned long flags;
 	unsigned char gpiodir;
 
-	if (offset >= gc->ngpio)
-		return -EINVAL;
-
 	spin_lock_irqsave(&chip->lock, flags);
 	writeb(!!value << offset, chip->base + (BIT(offset + 2)));
 	gpiodir = readb(chip->base + GPIODIR);