Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358765
b: refs/heads/master
c: cb1650d
h: refs/heads/master
i:
  358763: 4d0945f
v: v3
  • Loading branch information
Alexandre Courbot authored and Grant Likely committed Feb 9, 2013
1 parent aca1a5a commit f97e91b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 28 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: 125eef96f6cfadddbac8f6b9fccc9848988e7c6e
refs/heads/master: cb1650d4e0da27e88c1a1bd8fe98c40ae1a5d313
37 changes: 10 additions & 27 deletions trunk/drivers/gpio/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,45 +1890,28 @@ static void gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip)
static void *gpiolib_seq_start(struct seq_file *s, loff_t *pos)
{
struct gpio_chip *chip = NULL;
unsigned int gpio;
void *ret = NULL;
loff_t index = 0;
loff_t index = *pos;

/* REVISIT this isn't locked against gpio_chip removal ... */

for (gpio = 0; gpio_is_valid(gpio); gpio++) {
if (gpio_desc[gpio].chip == chip)
continue;

chip = gpio_desc[gpio].chip;
if (!chip)
continue;

if (index++ >= *pos) {
ret = chip;
break;
}
}

s->private = "";

return ret;
list_for_each_entry(chip, &gpio_chips, list)
if (index-- == 0)
return chip;

return NULL;
}

static void *gpiolib_seq_next(struct seq_file *s, void *v, loff_t *pos)
{
struct gpio_chip *chip = v;
unsigned int gpio;
void *ret = NULL;

/* skip GPIOs provided by the current chip */
for (gpio = chip->base + chip->ngpio; gpio_is_valid(gpio); gpio++) {
chip = gpio_desc[gpio].chip;
if (chip) {
ret = chip;
break;
}
}
if (list_is_last(&chip->list, &gpio_chips))
ret = NULL;
else
ret = list_entry(chip->list.next, struct gpio_chip, list);

s->private = "\n";
++*pos;
Expand Down

0 comments on commit f97e91b

Please sign in to comment.