Revert "Staging: android: timed_gpio: Request gpios."
author黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 14:27:08 +0000 (22:27 +0800)
committer黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 14:27:08 +0000 (22:27 +0800)
This reverts commit 6bb28b20afd42640ea80bcaabe4c24c3a8fe87e1.

drivers/staging/android/timed_gpio.c

index a646107da26d56754834b33b3ca985b0f6156803..be7cdaa783ae2fbdf79a444f370b35e352002646 100755 (executable)
@@ -106,17 +106,10 @@ static int timed_gpio_probe(struct platform_device *pdev)
                gpio_dat->dev.name = cur_gpio->name;
                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);
-               }
+               ret = timed_output_dev_register(&gpio_dat->dev);
                if (ret < 0) {
-                       for (j = 0; j < i; j++) {
+                       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;
                }
@@ -138,10 +131,8 @@ static int timed_gpio_remove(struct platform_device *pdev)
        struct timed_gpio_data *gpio_data = platform_get_drvdata(pdev);
        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);
-               gpio_free(gpio_data[i].gpio);
-       }
 
        kfree(gpio_data);