diff options
author | Igor Grinberg <grinberg@compulab.co.il> | 2011-05-03 11:22:09 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-05-12 05:52:06 -0400 |
commit | bc593f5d787d0a015539e21868302fb44a47c3e3 (patch) | |
tree | 75feac78712ae08e38b678c0dae62cb75765ddb0 /arch/arm/mach-omap2/gpmc-smsc911x.c | |
parent | 9e18630b689d658d65bf59508bfec084f61ff5c6 (diff) |
arm: omap2plus: GPIO cleanup
use gpio_request_<one|array>() instead of multiple gpiolib calls,
remove unneeded variables, etc.
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/gpmc-smsc911x.c')
-rw-r--r-- | arch/arm/mach-omap2/gpmc-smsc911x.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/gpmc-smsc911x.c b/arch/arm/mach-omap2/gpmc-smsc911x.c index e09374a48dd8..997033129d26 100644 --- a/arch/arm/mach-omap2/gpmc-smsc911x.c +++ b/arch/arm/mach-omap2/gpmc-smsc911x.c | |||
@@ -63,23 +63,22 @@ void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *board_data) | |||
63 | gpmc_smsc911x_resources[0].start = cs_mem_base + 0x0; | 63 | gpmc_smsc911x_resources[0].start = cs_mem_base + 0x0; |
64 | gpmc_smsc911x_resources[0].end = cs_mem_base + 0xff; | 64 | gpmc_smsc911x_resources[0].end = cs_mem_base + 0xff; |
65 | 65 | ||
66 | if (gpio_request(gpmc_cfg->gpio_irq, "smsc911x irq") < 0) { | 66 | if (gpio_request_one(gpmc_cfg->gpio_irq, GPIOF_IN, "smsc911x irq")) { |
67 | pr_err("Failed to request IRQ GPIO%d\n", gpmc_cfg->gpio_irq); | 67 | pr_err("Failed to request IRQ GPIO%d\n", gpmc_cfg->gpio_irq); |
68 | goto free1; | 68 | goto free1; |
69 | } | 69 | } |
70 | 70 | ||
71 | gpio_direction_input(gpmc_cfg->gpio_irq); | ||
72 | gpmc_smsc911x_resources[1].start = gpio_to_irq(gpmc_cfg->gpio_irq); | 71 | gpmc_smsc911x_resources[1].start = gpio_to_irq(gpmc_cfg->gpio_irq); |
73 | 72 | ||
74 | if (gpio_is_valid(gpmc_cfg->gpio_reset)) { | 73 | if (gpio_is_valid(gpmc_cfg->gpio_reset)) { |
75 | ret = gpio_request(gpmc_cfg->gpio_reset, "smsc911x reset"); | 74 | ret = gpio_request_one(gpmc_cfg->gpio_reset, |
75 | GPIOF_OUT_INIT_HIGH, "smsc911x reset"); | ||
76 | if (ret) { | 76 | if (ret) { |
77 | pr_err("Failed to request reset GPIO%d\n", | 77 | pr_err("Failed to request reset GPIO%d\n", |
78 | gpmc_cfg->gpio_reset); | 78 | gpmc_cfg->gpio_reset); |
79 | goto free2; | 79 | goto free2; |
80 | } | 80 | } |
81 | 81 | ||
82 | gpio_direction_output(gpmc_cfg->gpio_reset, 1); | ||
83 | gpio_set_value(gpmc_cfg->gpio_reset, 0); | 82 | gpio_set_value(gpmc_cfg->gpio_reset, 0); |
84 | msleep(100); | 83 | msleep(100); |
85 | gpio_set_value(gpmc_cfg->gpio_reset, 1); | 84 | gpio_set_value(gpmc_cfg->gpio_reset, 1); |