Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114819
b: refs/heads/master
c: c557fa3
h: refs/heads/master
i:
  114817: 5639c4e
  114815: b3dad57
v: v3
  • Loading branch information
Dmitry Baryshkov authored and Linus Torvalds committed Oct 16, 2008
1 parent b2aefaf commit 3e45177
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 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: 4fd5463c43d75ec919e27abdcfde1b199c19541e
refs/heads/master: c557fa3e4c156b8713c177d9dde08920130bf551
18 changes: 8 additions & 10 deletions trunk/drivers/gpio/max7301.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,6 @@ static int __devinit max7301_probe(struct spi_device *spi)
ts->chip.dev = &spi->dev;
ts->chip.owner = THIS_MODULE;

ret = gpiochip_add(&ts->chip);
if (ret)
goto exit_destroy;

/*
* tristate all pins in hardware and cache the
* register values for later use.
Expand All @@ -269,17 +265,19 @@ static int __devinit max7301_probe(struct spi_device *spi)
max7301_write(spi, 0x08 + i, 0xAA);
ts->port_config[i] = 0xAA;
for (j = 0; j < 4; j++) {
int idx = ts->chip.base + (i - 1) * 4 + j;
ret = gpio_direction_input(idx);
int offset = (i - 1) * 4 + j;
ret = max7301_direction_input(&ts->chip, offset);
if (ret)
goto exit_remove;
gpio_free(idx);
goto exit_destroy;
}
}

ret = gpiochip_add(&ts->chip);
if (ret)
goto exit_destroy;

return ret;

exit_remove:
gpiochip_remove(&ts->chip);
exit_destroy:
dev_set_drvdata(&spi->dev, NULL);
mutex_destroy(&ts->lock);
Expand Down

0 comments on commit 3e45177

Please sign in to comment.