ARM: tegra: cardhu: Request gpio before using it
Krishna Yarlagadda [Mon, 11 Jul 2011 08:51:40 +0000 (13:51 +0530)]
Modem disable pin direction changed without requesting
the gpio which results in a warning.

Fixing this by calling gpio_request before changing direction

Bug 825559

Original-Change-Id: Ic4b56c194a883b7b388013f0e5b75e7ed9dc9d50
Reviewed-on: http://git-master/r/40352
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

Rebase-Id: R379f347f5a06cdee3fa7918c4ff0096d1500f793

arch/arm/mach-tegra/board-cardhu.c

index 2bc18c5..519fa80 100644 (file)
@@ -603,7 +603,7 @@ static void cardhu_gps_init(void)
 static void cardhu_modem_init(void)
 {
        struct board_info board_info;
-       int w_disable_gpio;
+       int w_disable_gpio, ret;
 
        tegra_get_board_info(&board_info);
        switch (board_info.board_id) {
@@ -614,7 +614,12 @@ static void cardhu_modem_init(void)
                        w_disable_gpio = TEGRA_GPIO_PDD5;
                }
                tegra_gpio_enable(w_disable_gpio);
-               gpio_direction_input(w_disable_gpio);
+               ret = gpio_request(w_disable_gpio, "w_disable_gpio");
+               if (ret < 0)
+                       pr_err("%s: gpio_request failed for gpio %d\n",
+                               __func__, w_disable_gpio);
+               else
+                       gpio_direction_input(w_disable_gpio);
                break;
        default:
                break;