Commit 0445f154 authored by Arve Hjønnevåg's avatar Arve Hjønnevåg Committed by Greg Kroah-Hartman

Staging: android: timed_gpio: Request gpios.

Signed-off-by: default avatarArve Hjønnevåg <arve@android.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 81057ec1
...@@ -107,10 +107,17 @@ static int timed_gpio_probe(struct platform_device *pdev) ...@@ -107,10 +107,17 @@ static int timed_gpio_probe(struct platform_device *pdev)
gpio_dat->dev.name = cur_gpio->name; gpio_dat->dev.name = cur_gpio->name;
gpio_dat->dev.get_time = gpio_get_time; gpio_dat->dev.get_time = gpio_get_time;
gpio_dat->dev.enable = gpio_enable; gpio_dat->dev.enable = gpio_enable;
ret = timed_output_dev_register(&gpio_dat->dev); 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) { if (ret < 0) {
for (j = 0; j < i; j++) for (j = 0; j < i; j++) {
timed_output_dev_unregister(&gpio_data[i].dev); timed_output_dev_unregister(&gpio_data[i].dev);
gpio_free(gpio_data[i].gpio);
}
kfree(gpio_data); kfree(gpio_data);
return ret; return ret;
} }
...@@ -132,8 +139,10 @@ static int timed_gpio_remove(struct platform_device *pdev) ...@@ -132,8 +139,10 @@ static int timed_gpio_remove(struct platform_device *pdev)
struct timed_gpio_data *gpio_data = platform_get_drvdata(pdev); struct timed_gpio_data *gpio_data = platform_get_drvdata(pdev);
int i; int i;
for (i = 0; i < pdata->num_gpios; i++) for (i = 0; i < pdata->num_gpios; i++) {
timed_output_dev_unregister(&gpio_data[i].dev); timed_output_dev_unregister(&gpio_data[i].dev);
gpio_free(gpio_data[i].gpio);
}
kfree(gpio_data); kfree(gpio_data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment