Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97261
b: refs/heads/master
c: bff5fda
h: refs/heads/master
i:
  97259: 8b8fb2b
v: v3
  • Loading branch information
Trent Piepho authored and Linus Torvalds committed May 24, 2008
1 parent 3f28118 commit 81f8367
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d1c1d9b557a12320174058d2d313ffb0f8611f4
refs/heads/master: bff5fda972dc23bd1806a47c2098ae173585d013
6 changes: 3 additions & 3 deletions trunk/drivers/gpio/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int __init gpiochip_reserve(int start, int ngpio)
unsigned long flags;
int i;

if (!gpio_is_valid(start) || !gpio_is_valid(start + ngpio))
if (!gpio_is_valid(start) || !gpio_is_valid(start + ngpio - 1))
return -EINVAL;

spin_lock_irqsave(&gpio_lock, flags);
Expand Down Expand Up @@ -170,7 +170,7 @@ int gpiochip_add(struct gpio_chip *chip)
unsigned id;
int base = chip->base;

if ((!gpio_is_valid(base) || !gpio_is_valid(base + chip->ngpio))
if ((!gpio_is_valid(base) || !gpio_is_valid(base + chip->ngpio - 1))
&& base >= 0) {
status = -EINVAL;
goto fail;
Expand Down Expand Up @@ -207,7 +207,7 @@ int gpiochip_add(struct gpio_chip *chip)
/* failures here can mean systems won't boot... */
if (status)
pr_err("gpiochip_add: gpios %d..%d (%s) not registered\n",
chip->base, chip->base + chip->ngpio,
chip->base, chip->base + chip->ngpio - 1,
chip->label ? : "generic");
return status;
}
Expand Down

0 comments on commit 81f8367

Please sign in to comment.