Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299108
b: refs/heads/master
c: 5d92f71
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Greg Kroah-Hartman committed Apr 10, 2012
1 parent 33cf44b commit 83249e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 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: 099f5d01a6f73712e17552679aa724e021809a6e
refs/heads/master: 5d92f71e687e4e1a0bed489707d1ec58fe1100de
27 changes: 15 additions & 12 deletions trunk/drivers/staging/android/timed_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static int timed_gpio_probe(struct platform_device *pdev)
struct timed_gpio_platform_data *pdata = pdev->dev.platform_data;
struct timed_gpio *cur_gpio;
struct timed_gpio_data *gpio_data, *gpio_dat;
int i, j, ret = 0;
int i, ret;

if (!pdata)
return -EBUSY;
Expand All @@ -108,18 +108,12 @@ static int timed_gpio_probe(struct platform_device *pdev)
gpio_dat->dev.get_time = gpio_get_time;
gpio_dat->dev.enable = gpio_enable;
ret = gpio_request(cur_gpio->gpio, cur_gpio->name);
if (ret >= 0) {
ret = timed_output_dev_register(&gpio_dat->dev);
if (ret < 0)
gpio_free(cur_gpio->gpio);
}
if (ret < 0)
goto err_out;
ret = timed_output_dev_register(&gpio_dat->dev);
if (ret < 0) {
for (j = 0; j < i; j++) {
timed_output_dev_unregister(&gpio_data[i].dev);
gpio_free(gpio_data[i].gpio);
}
kfree(gpio_data);
return ret;
gpio_free(cur_gpio->gpio);
goto err_out;
}

gpio_dat->gpio = cur_gpio->gpio;
Expand All @@ -131,6 +125,15 @@ static int timed_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, gpio_data);

return 0;

err_out:
while (--i >= 0) {
timed_output_dev_unregister(&gpio_data[i].dev);
gpio_free(gpio_data[i].gpio);
}
kfree(gpio_data);

return ret;
}

static int timed_gpio_remove(struct platform_device *pdev)
Expand Down

0 comments on commit 83249e6

Please sign in to comment.