Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 370990
b: refs/heads/master
c: 7fafae6
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare authored and Wolfram Sang committed Mar 27, 2013
1 parent 8bf256b commit 00794b4
Show file tree
Hide file tree
Showing 2 changed files with 15 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: 1b295c839b3931244f37cb52265017b298518f69
refs/heads/master: 7fafae669a623b003d9d40b75ab31bb9625d5c38
17 changes: 14 additions & 3 deletions trunk/drivers/i2c/muxes/i2c-mux-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,21 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev)

for (i = 0; i < mux->data.n_gpios; i++) {
ret = gpio_request(gpio_base + mux->data.gpios[i], "i2c-mux-gpio");
if (ret)
if (ret) {
dev_err(&pdev->dev, "Failed to request GPIO %d\n",
mux->data.gpios[i]);
goto err_request_gpio;
gpio_direction_output(gpio_base + mux->data.gpios[i],
initial_state & (1 << i));
}

ret = gpio_direction_output(gpio_base + mux->data.gpios[i],
initial_state & (1 << i));
if (ret) {
dev_err(&pdev->dev,
"Failed to set direction of GPIO %d to output\n",
mux->data.gpios[i]);
i++; /* gpio_request above succeeded, so must free */
goto err_request_gpio;
}
}

for (i = 0; i < mux->data.n_values; i++) {
Expand Down

0 comments on commit 00794b4

Please sign in to comment.