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/board-omap3pandora.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/board-omap3pandora.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3pandora.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 6c22d3f238eb..78dd2a7fe6e6 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
@@ -305,24 +305,13 @@ static int omap3pandora_twl_gpio_setup(struct device *dev, | |||
305 | 305 | ||
306 | /* gpio + 13 drives 32kHz buffer for wifi module */ | 306 | /* gpio + 13 drives 32kHz buffer for wifi module */ |
307 | gpio_32khz = gpio + 13; | 307 | gpio_32khz = gpio + 13; |
308 | ret = gpio_request(gpio_32khz, "wifi 32kHz"); | 308 | ret = gpio_request_one(gpio_32khz, GPIOF_OUT_INIT_HIGH, "wifi 32kHz"); |
309 | if (ret < 0) { | 309 | if (ret < 0) { |
310 | pr_err("Cannot get GPIO line %d, ret=%d\n", gpio_32khz, ret); | 310 | pr_err("Cannot get GPIO line %d, ret=%d\n", gpio_32khz, ret); |
311 | goto fail; | 311 | return -ENODEV; |
312 | } | ||
313 | |||
314 | ret = gpio_direction_output(gpio_32khz, 1); | ||
315 | if (ret < 0) { | ||
316 | pr_err("Cannot set GPIO line %d, ret=%d\n", gpio_32khz, ret); | ||
317 | goto fail_direction; | ||
318 | } | 312 | } |
319 | 313 | ||
320 | return 0; | 314 | return 0; |
321 | |||
322 | fail_direction: | ||
323 | gpio_free(gpio_32khz); | ||
324 | fail: | ||
325 | return -ENODEV; | ||
326 | } | 315 | } |
327 | 316 | ||
328 | static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { | 317 | static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { |
@@ -584,14 +573,10 @@ static void __init pandora_wl1251_init(void) | |||
584 | 573 | ||
585 | memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata)); | 574 | memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata)); |
586 | 575 | ||
587 | ret = gpio_request(PANDORA_WIFI_IRQ_GPIO, "wl1251 irq"); | 576 | ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq"); |
588 | if (ret < 0) | 577 | if (ret < 0) |
589 | goto fail; | 578 | goto fail; |
590 | 579 | ||
591 | ret = gpio_direction_input(PANDORA_WIFI_IRQ_GPIO); | ||
592 | if (ret < 0) | ||
593 | goto fail_irq; | ||
594 | |||
595 | pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO); | 580 | pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO); |
596 | if (pandora_wl1251_pdata.irq < 0) | 581 | if (pandora_wl1251_pdata.irq < 0) |
597 | goto fail_irq; | 582 | goto fail_irq; |